summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/ClangExpressionDeclMap.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2010-11-13 03:52:47 +0000
committerGreg Clayton <gclayton@apple.com>2010-11-13 03:52:47 +0000
commit526e5afb2d616f483d44aa393473e93d962af6a0 (patch)
tree556d76a66a0884e230910c37925ce20fe8b04aff /lldb/source/Expression/ClangExpressionDeclMap.cpp
parentf01b622902269c7fc01fbd9b26393eabdfb82076 (diff)
downloadbcm5719-llvm-526e5afb2d616f483d44aa393473e93d962af6a0.tar.gz
bcm5719-llvm-526e5afb2d616f483d44aa393473e93d962af6a0.zip
Modified the lldb_private::Type clang type resolving code to handle three
cases when getting the clang type: - need only a forward declaration - need a clang type that can be used for layout (members and args/return types) - need a full clang type This allows us to partially parse the clang types and be as lazy as possible. The first case is when we just need to declare a type and we will complete it later. The forward declaration happens only for class/union/structs and enums. The layout type allows us to resolve the full clang type _except_ if we have any modifiers on a pointer or reference (both R and L value). In this case when we are adding members or function args or return types, we only need to know how the type will be laid out and we can defer completing the pointee type until we later need it. The last type means we need a full definition for the clang type. Did some renaming of some enumerations to get rid of the old "DC" prefix (which stands for DebugCore which is no longer around). Modified the clang namespace support to be almost ready to be fed to the expression parser. I made a new ClangNamespaceDecl class that can carry around the AST and the namespace decl so we can copy it into the expression AST. I modified the symbol vendor and symbol file plug-ins to use this new class. llvm-svn: 118976
Diffstat (limited to 'lldb/source/Expression/ClangExpressionDeclMap.cpp')
-rw-r--r--lldb/source/Expression/ClangExpressionDeclMap.cpp30
1 files changed, 28 insertions, 2 deletions
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp
index aa7d458badb..92b1ebb0cd0 100644
--- a/lldb/source/Expression/ClangExpressionDeclMap.cpp
+++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp
@@ -23,6 +23,7 @@
#include "lldb/Expression/ClangASTSource.h"
#include "lldb/Expression/ClangPersistentVariables.h"
#include "lldb/Symbol/ClangASTContext.h"
+#include "lldb/Symbol/ClangNamespaceDecl.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/ObjectFile.h"
@@ -760,7 +761,7 @@ ClangExpressionDeclMap::DoMaterializeOneVariable
break;
case Value::eValueTypeScalar:
{
- if (location_value->GetContextType() != Value::eContextTypeDCRegisterInfo)
+ if (location_value->GetContextType() != Value::eContextTypeRegisterInfo)
{
StreamString ss;
@@ -1019,6 +1020,18 @@ ClangExpressionDeclMap::GetDecls (NameSearchContext &context, const ConstString
else if (non_extern_symbol)
AddOneFunction(context, NULL, non_extern_symbol);
}
+
+ ClangNamespaceDecl namespace_decl (m_sym_ctx.FindNamespace(name));
+ if (namespace_decl)
+ {
+// clang::NamespaceDecl *clang_namespace_decl = AddNamespace(context, namespace_decl);
+// if (clang_namespace_decl)
+// {
+// // TODO: is this how we get the decl lookups to be called for
+// // this namespace??
+// clang_namespace_decl->setHasExternalLexicalStorage();
+// }
+ }
}
}
else
@@ -1179,7 +1192,7 @@ ClangExpressionDeclMap::GetVariableValue
type_to_use = var_opaque_type;
if (var_location.get()->GetContextType() == Value::eContextTypeInvalid)
- var_location.get()->SetContext(Value::eContextTypeOpaqueClangQualType, type_to_use);
+ var_location.get()->SetContext(Value::eContextTypeClangType, type_to_use);
if (var_location.get()->GetValueType() == Value::eValueTypeFileAddress)
{
@@ -1279,6 +1292,19 @@ ClangExpressionDeclMap::AddOneVariable(NameSearchContext &context,
}
}
+clang::NamespaceDecl *
+ClangExpressionDeclMap::AddNamespace (NameSearchContext &context, const ClangNamespaceDecl &namespace_decl)
+{
+ lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
+
+
+ clang::Decl *copied_decl = ClangASTContext::CopyDecl (context.GetASTContext(),
+ namespace_decl.GetASTContext(),
+ namespace_decl.GetNamespaceDecl());
+
+ return dyn_cast<clang::NamespaceDecl>(copied_decl);
+}
+
void
ClangExpressionDeclMap::AddOneFunction(NameSearchContext &context,
Function* fun,
OpenPOWER on IntegriCloud