aboutsummaryrefslogtreecommitdiff
path: root/source/Symbol/Function.cpp
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2014-11-25 21:00:58 +0000
committerEd Maste <emaste@FreeBSD.org>2014-11-25 21:00:58 +0000
commit0cac4ca3916ac24ab6139d03cbfd18db9e715bfe (patch)
treec94307da318be46e5aeea1a325c1e91749506e4f /source/Symbol/Function.cpp
parent03b99097822ca3ac69252d9afae716a584ed56c4 (diff)
downloadsrc-0cac4ca3916ac24ab6139d03cbfd18db9e715bfe.tar.gz
src-0cac4ca3916ac24ab6139d03cbfd18db9e715bfe.zip
Import LLDB as of upstream SVN r216948 (git 50f7fe44)vendor/lldb/lldb-r216948
This corresponds with the branchpoint for the 3.5 release. A number of files not required for the FreeBSD build have been removed. Sponsored by: DARPA, AFRL
Notes
Notes: svn path=/vendor/lldb/dist/; revision=275072 svn path=/vendor/lldb/lldb-r216948/; revision=275074; tag=vendor/lldb/lldb-r216948
Diffstat (limited to 'source/Symbol/Function.cpp')
-rw-r--r--source/Symbol/Function.cpp46
1 files changed, 21 insertions, 25 deletions
diff --git a/source/Symbol/Function.cpp b/source/Symbol/Function.cpp
index e6d6c000bc97..0b7430ad75e3 100644
--- a/source/Symbol/Function.cpp
+++ b/source/Symbol/Function.cpp
@@ -215,7 +215,7 @@ Function::Function
m_prologue_byte_size (0)
{
m_block.SetParentScope(this);
- assert(comp_unit != NULL);
+ assert(comp_unit != nullptr);
}
Function::Function
@@ -239,7 +239,7 @@ Function::Function
m_prologue_byte_size (0)
{
m_block.SetParentScope(this);
- assert(comp_unit != NULL);
+ assert(comp_unit != nullptr);
}
@@ -253,10 +253,10 @@ Function::GetStartLineSourceInfo (FileSpec &source_file, uint32_t &line_no)
line_no = 0;
source_file.Clear();
- if (m_comp_unit == NULL)
+ if (m_comp_unit == nullptr)
return;
- if (m_type != NULL && m_type->GetDeclaration().GetLine() != 0)
+ if (m_type != nullptr && m_type->GetDeclaration().GetLine() != 0)
{
source_file = m_type->GetDeclaration().GetFile();
line_no = m_type->GetDeclaration().GetLine();
@@ -264,11 +264,11 @@ Function::GetStartLineSourceInfo (FileSpec &source_file, uint32_t &line_no)
else
{
LineTable *line_table = m_comp_unit->GetLineTable();
- if (line_table == NULL)
+ if (line_table == nullptr)
return;
LineEntry line_entry;
- if (line_table->FindLineEntryByAddress (GetAddressRange().GetBaseAddress(), line_entry, NULL))
+ if (line_table->FindLineEntryByAddress (GetAddressRange().GetBaseAddress(), line_entry, nullptr))
{
line_no = line_entry.line;
source_file = line_entry.file;
@@ -288,11 +288,11 @@ Function::GetEndLineSourceInfo (FileSpec &source_file, uint32_t &line_no)
scratch_addr.SetOffset (scratch_addr.GetOffset() + GetAddressRange().GetByteSize() - 1);
LineTable *line_table = m_comp_unit->GetLineTable();
- if (line_table == NULL)
+ if (line_table == nullptr)
return;
LineEntry line_entry;
- if (line_table->FindLineEntryByAddress (scratch_addr, line_entry, NULL))
+ if (line_table->FindLineEntryByAddress (scratch_addr, line_entry, nullptr))
{
line_no = line_entry.line;
source_file = line_entry.file;
@@ -354,20 +354,16 @@ Function::GetDescription(Stream *s, lldb::DescriptionLevel level, Target *target
void
Function::Dump(Stream *s, bool show_context) const
{
- s->Printf("%p: ", this);
+ s->Printf("%p: ", static_cast<const void*>(this));
s->Indent();
- *s << "Function" << (const UserID&)*this;
+ *s << "Function" << static_cast<const UserID&>(*this);
m_mangled.Dump(s);
if (m_type)
- {
- s->Printf(", type = %p", m_type);
- }
+ s->Printf(", type = %p", static_cast<void*>(m_type));
else if (m_type_uid != LLDB_INVALID_UID)
- {
s->Printf(", type_uid = 0x%8.8" PRIx64, m_type_uid);
- }
s->EOL();
// Dump the root object
@@ -415,7 +411,7 @@ Function::GetInstructions (const ExecutionContext &exe_ctx,
{
const bool prefer_file_cache = false;
return Disassembler::DisassembleRange (module_sp->GetArchitecture(),
- NULL,
+ nullptr,
flavor,
exe_ctx,
GetAddressRange(),
@@ -471,17 +467,17 @@ Function::GetClangDeclContext()
CalculateSymbolContext (&sc);
if (!sc.module_sp)
- return NULL;
+ return nullptr;
SymbolVendor *sym_vendor = sc.module_sp->GetSymbolVendor();
if (!sym_vendor)
- return NULL;
+ return nullptr;
SymbolFile *sym_file = sym_vendor->GetSymbolFile();
if (!sym_file)
- return NULL;
+ return nullptr;
return sym_file->GetClangDeclContextForTypeUID (sc, m_uid);
}
@@ -489,24 +485,24 @@ Function::GetClangDeclContext()
Type*
Function::GetType()
{
- if (m_type == NULL)
+ if (m_type == nullptr)
{
SymbolContext sc;
CalculateSymbolContext (&sc);
if (!sc.module_sp)
- return NULL;
+ return nullptr;
SymbolVendor *sym_vendor = sc.module_sp->GetSymbolVendor();
- if (sym_vendor == NULL)
- return NULL;
+ if (sym_vendor == nullptr)
+ return nullptr;
SymbolFile *sym_file = sym_vendor->GetSymbolFile();
- if (sym_file == NULL)
- return NULL;
+ if (sym_file == nullptr)
+ return nullptr;
m_type = sym_file->ResolveTypeUID(m_type_uid);
}