summaryrefslogtreecommitdiffstats
path: root/lldb/source/Symbol/Function.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2011-08-05 23:43:37 +0000
committerSean Callanan <scallanan@apple.com>2011-08-05 23:43:37 +0000
commit72e4940bd1765afaab46619921cfef681c990d83 (patch)
treef49f14cc3da8f89c173d4ef08e04108aafd4c10a /lldb/source/Symbol/Function.cpp
parent1cd34b8fea60940f99b6a8ce3fd6418953887125 (diff)
downloadbcm5719-llvm-72e4940bd1765afaab46619921cfef681c990d83.tar.gz
bcm5719-llvm-72e4940bd1765afaab46619921cfef681c990d83.zip
This is an overhaul of the expression parser code
that detects what context the current expression is meant to execute in. LLDB now properly consults the method declaration in the debug information rather than trying to hunt down the "this" or "self" pointer by name, which can be misleading. Other fixes include: - LLDB now properly detects that it is inside an inlined C++ member function. - LLDB now allows access to non-const members when in const code. - The functions in SymbolFile that locate the DeclContext containing a DIE have been renamed to reflect what they actually do. I have added new functions that find the DeclContext for the DIE itself. I have also introduced testcases for C++ and Objective-C. llvm-svn: 136999
Diffstat (limited to 'lldb/source/Symbol/Function.cpp')
-rw-r--r--lldb/source/Symbol/Function.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/lldb/source/Symbol/Function.cpp b/lldb/source/Symbol/Function.cpp
index c2ef05d3251..5328159fdb7 100644
--- a/lldb/source/Symbol/Function.cpp
+++ b/lldb/source/Symbol/Function.cpp
@@ -14,6 +14,7 @@
#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/LineTable.h"
+#include "lldb/Symbol/SymbolFile.h"
#include "lldb/Symbol/SymbolVendor.h"
#include "clang/AST/Type.h"
#include "clang/AST/CanonicalType.h"
@@ -399,6 +400,29 @@ Function::MemorySize () const
return mem_size;
}
+clang::DeclContext *
+Function::GetClangDeclContext()
+{
+ SymbolContext sc;
+
+ CalculateSymbolContext (&sc);
+
+ if (!sc.module_sp)
+ return NULL;
+
+ SymbolVendor *sym_vendor = sc.module_sp->GetSymbolVendor();
+
+ if (!sym_vendor)
+ return NULL;
+
+ SymbolFile *sym_file = sym_vendor->GetSymbolFile();
+
+ if (!sym_file)
+ return NULL;
+
+ return sym_file->GetClangDeclContextForTypeUID (sc, m_uid);
+}
+
Type*
Function::GetType()
{
OpenPOWER on IntegriCloud