summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/ASTResultSynthesizer.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2011-12-06 03:41:14 +0000
committerSean Callanan <scallanan@apple.com>2011-12-06 03:41:14 +0000
commit0eed0d42a0222e35892652751c2af4b49d174364 (patch)
tree9c53d7492e0e487329032e2c47e349c9b0708c3b /lldb/source/Expression/ASTResultSynthesizer.cpp
parent32772f779036d8ff6e3ee93c84829e6e7491af6a (diff)
downloadbcm5719-llvm-0eed0d42a0222e35892652751c2af4b49d174364.tar.gz
bcm5719-llvm-0eed0d42a0222e35892652751c2af4b49d174364.zip
As part of the work to make Objective-C type information
from symbols more accessible, I have added a second map to the ClangASTImporter: the ObjCInterfaceMetaMap. This map keeps track of all type definitions found for a particular Objective-C interface, allowing the ClangASTSource to refer to all possible sources when looking for method definitions. There is a bug in lookup that I still need to figure out, but after that we should be able to report full method information for Objective-C classes shown in symbols. Also fixed some errors I ran into when enabling the maps for the persistent type store. The persistent type store previously did not use the ClangASTImporter to import types, instead using ASTImporters that got allocated each time a type needed copying. To support the requirements of the persistent type store -- namely, that types must be copied, completed, and then completely severed from their origin in the parser's AST context (which will go away) -- I added a new function called DeportType which severs all these connections. llvm-svn: 145914
Diffstat (limited to 'lldb/source/Expression/ASTResultSynthesizer.cpp')
-rw-r--r--lldb/source/Expression/ASTResultSynthesizer.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/lldb/source/Expression/ASTResultSynthesizer.cpp b/lldb/source/Expression/ASTResultSynthesizer.cpp
index f28f8f1b735..ff3b2f4814d 100644
--- a/lldb/source/Expression/ASTResultSynthesizer.cpp
+++ b/lldb/source/Expression/ASTResultSynthesizer.cpp
@@ -22,6 +22,8 @@
#include "lldb/Expression/ClangPersistentVariables.h"
#include "lldb/Expression/ASTResultSynthesizer.h"
#include "lldb/Symbol/ClangASTContext.h"
+#include "lldb/Symbol/ClangASTImporter.h"
+#include "lldb/Target/Target.h"
using namespace llvm;
using namespace clang;
@@ -29,13 +31,11 @@ using namespace lldb_private;
ASTResultSynthesizer::ASTResultSynthesizer(ASTConsumer *passthrough,
TypeFromUser desired_type,
- ASTContext &scratch_ast_context,
- ClangPersistentVariables &persistent_vars) :
+ Target &target) :
m_ast_context (NULL),
m_passthrough (passthrough),
m_passthrough_sema (NULL),
- m_scratch_ast_context (scratch_ast_context),
- m_persistent_vars (persistent_vars),
+ m_target (target),
m_sema (NULL),
m_desired_type (desired_type)
{
@@ -442,14 +442,12 @@ ASTResultSynthesizer::MaybeRecordPersistentType(TypeDecl *D)
if (log)
log->Printf ("Recording persistent type %s\n", name_cs.GetCString());
- Decl *D_scratch = ClangASTContext::CopyDecl(&m_scratch_ast_context,
- m_ast_context,
- D);
+ Decl *D_scratch = m_target.GetClangASTImporter()->DeportDecl(m_target.GetScratchClangASTContext()->getASTContext(),
+ m_ast_context,
+ D);
- TypeDecl *TD_scratch = dyn_cast<TypeDecl>(D_scratch);
-
- if (TD_scratch)
- m_persistent_vars.RegisterPersistentType(name_cs, TD_scratch);
+ if (TypeDecl *TypeDecl_scratch = dyn_cast<TypeDecl>(D_scratch))
+ m_target.GetPersistentVariables().RegisterPersistentType(name_cs, TypeDecl_scratch);
}
void
OpenPOWER on IntegriCloud