Move a bunch of trivial methods into the header. These compile down to 1-2

instructions so it's really profitable to inline them.

llvm-svn: 106450
This commit is contained in:
Benjamin Kramer 2010-06-21 19:26:54 +00:00
parent 0ca648d758
commit 466b31e900
6 changed files with 36 additions and 239 deletions

View File

@ -132,11 +132,6 @@ public:
//------------------------------------------------------------------
Address (lldb::addr_t file_addr, const SectionList * section_list);
//------------------------------------------------------------------
/// Destructor.
//------------------------------------------------------------------
~Address ();
//------------------------------------------------------------------
/// Assignment operator.
///
@ -283,7 +278,7 @@ public:
/// doesn't contain a valid offset.
//------------------------------------------------------------------
lldb::addr_t
GetOffset () const;
GetOffset () const { return m_offset; }
//------------------------------------------------------------------
/// Check if an address is section offset.
@ -362,7 +357,7 @@ public:
/// offset in, or NULL if this address is absolute.
//------------------------------------------------------------------
const Section*
GetSection() const;
GetSection() const { return m_section; }
//------------------------------------------------------------------
/// Set accessor for the offset.
@ -385,7 +380,7 @@ public:
/// any section.
//------------------------------------------------------------------
void
SetSection (const Section* section);
SetSection (const Section* section) { m_section = section; }
//------------------------------------------------------------------
/// @copydoc SymbolContextScope::CalculateSymbolContext(SymbolContext*)

View File

@ -227,7 +227,7 @@ public:
/// A reference to the base address object.
//------------------------------------------------------------------
Address &
GetBaseAddress();
GetBaseAddress() { return m_base_addr; }
//------------------------------------------------------------------
/// Get const accessor for the base address of the range.
@ -236,7 +236,7 @@ public:
/// A const reference to the base address object.
//------------------------------------------------------------------
const Address &
GetBaseAddress() const;
GetBaseAddress() const { return m_base_addr; }
//------------------------------------------------------------------
/// Get accessor for the byte size of this range.
@ -245,7 +245,7 @@ public:
/// The size in bytes of this address range.
//------------------------------------------------------------------
lldb::addr_t
GetByteSize () const;
GetByteSize () const { return m_byte_size; }
//------------------------------------------------------------------
/// Get the memory cost of this object.
@ -254,7 +254,11 @@ public:
/// The number of bytes that this object occupies in memory.
//------------------------------------------------------------------
size_t
MemorySize () const;
MemorySize () const {
// Noting special for the memory size of a single AddressRange object,
// it is just the size of itself.
return sizeof(AddressRange);
}
//------------------------------------------------------------------
/// Set accessor for the byte size of this range.
@ -263,7 +267,7 @@ public:
/// The new size in bytes of this address range.
//------------------------------------------------------------------
void
SetByteSize (lldb::addr_t byte_size);
SetByteSize (lldb::addr_t byte_size) { m_byte_size = byte_size; }
protected:
//------------------------------------------------------------------

View File

@ -68,88 +68,88 @@ public:
GetAddressRangePtr () const;
AddressRange &
GetAddressRangeRef();
GetAddressRangeRef() { return m_addr_range; }
const AddressRange &
GetAddressRangeRef() const;
GetAddressRangeRef() const { return m_addr_range; }
Mangled&
GetMangled ();
GetMangled () { return m_mangled; }
const Mangled&
GetMangled () const;
GetMangled () const { return m_mangled; }
bool
GetSizeIsSibling () const;
GetSizeIsSibling () const { return m_size_is_sibling; }
bool
GetSizeIsSynthesized() const;
GetSizeIsSynthesized() const { return m_size_is_synthesized; }
uint32_t
GetSiblingIndex () const;
uint32_t
GetByteSize () const;
GetByteSize () const { return m_addr_range.GetByteSize(); }
lldb::SymbolType
GetType () const;
GetType () const { return m_type; }
void
SetType (lldb::SymbolType type);
SetType (lldb::SymbolType type) { m_type = type; }
const char *
GetTypeAsString () const;
uint32_t
GetFlags () const;
GetFlags () const { return m_flags; }
void
SetFlags (uint32_t flags);
SetFlags (uint32_t flags) { m_flags = flags; }
Function *
GetFunction ();
Address &
GetValue ();
GetValue () { return m_addr_range.GetBaseAddress(); }
const Address &
GetValue () const;
GetValue () const { return m_addr_range.GetBaseAddress(); }
bool
IsSynthetic () const;
IsSynthetic () const { return m_is_synthetic; }
void
SetIsSynthetic (bool b);
SetIsSynthetic (bool b) { m_is_synthetic = b; }
void
SetSizeIsSynthesized(bool b);
SetSizeIsSynthesized(bool b) { m_size_is_synthesized = b; }
bool
IsDebug () const;
IsDebug () const { return m_is_debug; }
void
SetDebug (bool b);
SetDebug (bool b) { m_is_debug = b; }
bool
IsExternal () const;
IsExternal () const { return m_is_external; }
void
SetExternal (bool b);
SetExternal (bool b) { m_is_external = b; }
bool
IsTrampoline () const;
void
SetByteSize (uint32_t size);
SetByteSize (uint32_t size) { m_addr_range.SetByteSize(size); }
void
SetSizeIsSibling (bool b);
SetSizeIsSibling (bool b) { m_size_is_sibling = b; }
void
SetValue (Address &value);
SetValue (Address &value) { m_addr_range.GetBaseAddress() = value; }
void
SetValue (const AddressRange &range);
SetValue (const AddressRange &range) { m_addr_range = range; }
void
SetValue (lldb::addr_t value);

View File

@ -247,11 +247,6 @@ Address::Address (addr_t address, const SectionList * sections) :
ResolveAddressUsingFileSections(address, sections);
}
Address::~Address ()
{
}
const Address&
Address::operator= (const Address& rhs)
{
@ -321,13 +316,6 @@ Address::GetModule () const
return NULL;
}
const Section*
Address::GetSection () const
{
return m_section;
}
//addr_t
//Address::Address() const
//{
@ -381,12 +369,6 @@ Address::GetLoadAddress (Process *process) const
return m_offset;
}
addr_t
Address::GetOffset () const
{
return m_offset;
}
bool
Address::SetOffset (addr_t offset)
{
@ -395,12 +377,6 @@ Address::SetOffset (addr_t offset)
return changed;
}
void
Address::SetSection (const Section* section)
{
m_section = section;
}
void
Address::Clear()
{

View File

@ -42,30 +42,6 @@ AddressRange::~AddressRange ()
{
}
Address &
AddressRange::GetBaseAddress()
{
return m_base_addr;
}
const Address &
AddressRange::GetBaseAddress() const
{
return m_base_addr;
}
addr_t
AddressRange::GetByteSize() const
{
return m_byte_size;
}
void
AddressRange::SetByteSize(addr_t byte_size)
{
m_byte_size = byte_size;
}
//bool
//AddressRange::Contains (const Address &addr) const
//{
@ -204,14 +180,6 @@ AddressRange::DumpDebug (Stream *s) const
{
s->Printf("%.*p: AddressRange section = %*p, offset = 0x%16.16llx, byte_size = 0x%16.16llx\n", (int)sizeof(void*) * 2, this, (int)sizeof(void*) * 2, m_base_addr.GetSection(), m_base_addr.GetOffset(), GetByteSize());
}
size_t
AddressRange::MemorySize () const
{
// Noting special for the memory size of a single AddressRange object,
// it is just the size of itself.
return sizeof(AddressRange);
}
//
//bool
//lldb::operator== (const AddressRange& lhs, const AddressRange& rhs)

View File

@ -139,18 +139,6 @@ Symbol::operator= (const Symbol& rhs)
return *this;
}
AddressRange &
Symbol::GetAddressRangeRef()
{
return m_addr_range;
}
const AddressRange &
Symbol::GetAddressRangeRef() const
{
return m_addr_range;
}
AddressRange *
Symbol::GetAddressRangePtr()
{
@ -167,115 +155,18 @@ Symbol::GetAddressRangePtr() const
return NULL;
}
bool
Symbol::GetSizeIsSibling() const
{
return m_size_is_sibling;
}
bool
Symbol::GetSizeIsSynthesized() const
{
return m_size_is_synthesized;
}
uint32_t
Symbol::GetSiblingIndex() const
{
return m_size_is_sibling ? m_addr_range.GetByteSize() : 0;
}
uint32_t
Symbol::GetFlags() const
{
return m_flags;
}
void
Symbol::SetFlags (uint32_t flags)
{
m_flags = flags;
}
SymbolType
Symbol::GetType() const
{
return m_type;
}
void
Symbol::SetType(SymbolType type)
{
m_type = type;
}
bool
Symbol::IsSynthetic () const
{
return m_is_synthetic;
}
void
Symbol::SetIsSynthetic (bool b)
{
m_is_synthetic = b;
}
void
Symbol::SetSizeIsSynthesized(bool b)
{
m_size_is_synthesized = b;
}
bool
Symbol::IsDebug() const
{
return m_is_debug;
}
void
Symbol::SetDebug (bool b)
{
m_is_debug = b;
}
bool
Symbol::IsExternal() const
{
return m_is_external;
}
void
Symbol::SetExternal(bool b)
{
m_is_external = b;
}
bool
Symbol::IsTrampoline () const
{
return m_type == eSymbolTypeTrampoline;
}
uint32_t
Symbol::GetByteSize() const
{
return m_addr_range.GetByteSize();
}
void
Symbol::SetByteSize (uint32_t size)
{
m_addr_range.SetByteSize(size);
}
void
Symbol::SetSizeIsSibling (bool b)
{
m_size_is_sibling = b;
}
void
Symbol::Dump(Stream *s, Process *process, uint32_t index) const
{
@ -322,36 +213,6 @@ Symbol::Dump(Stream *s, Process *process, uint32_t index) const
}
}
const Mangled&
Symbol::GetMangled() const
{
return m_mangled;
}
Mangled&
Symbol::GetMangled()
{
return m_mangled;
}
Address &
Symbol::GetValue()
{
return m_addr_range.GetBaseAddress();
}
const Address &
Symbol::GetValue() const
{
return m_addr_range.GetBaseAddress();
}
void
Symbol::SetValue (Address &value)
{
m_addr_range.GetBaseAddress() = value;
}
Function *
Symbol::GetFunction ()
{
@ -396,13 +257,6 @@ Symbol::GetPrologueByteSize ()
return 0;
}
void
Symbol::SetValue (const AddressRange &range)
{
m_addr_range = range;
}
void
Symbol::SetValue(addr_t value)
{