[Lldb-commits] [lldb] r144712 - in /lldb/trunk: include/lldb/Symbol/ClangASTImporter.h include/lldb/Target/Target.h include/lldb/lldb-forward.h source/Target/Target.cpp

Sean Callanan scallanan at apple.com
Tue Nov 15 14:27:19 PST 2011


Author: spyffe
Date: Tue Nov 15 16:27:19 2011
New Revision: 144712

URL: http://llvm.org/viewvc/llvm-project?rev=144712&view=rev
Log:
Made Target own a ClangASTSource that will be used
to complete types in the scratch AST context.

Modified:
    lldb/trunk/include/lldb/Symbol/ClangASTImporter.h
    lldb/trunk/include/lldb/Target/Target.h
    lldb/trunk/include/lldb/lldb-forward.h
    lldb/trunk/source/Target/Target.cpp

Modified: lldb/trunk/include/lldb/Symbol/ClangASTImporter.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTImporter.h?rev=144712&r1=144711&r2=144712&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangASTImporter.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTImporter.h Tue Nov 15 16:27:19 2011
@@ -93,7 +93,6 @@
     
     void BuildNamespaceMap (const clang::NamespaceDecl *decl);
 private:
-    
     struct DeclOrigin 
     {
         DeclOrigin () :

Modified: lldb/trunk/include/lldb/Target/Target.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=144712&r1=144711&r2=144712&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Target.h (original)
+++ lldb/trunk/include/lldb/Target/Target.h Tue Nov 15 16:27:19 2011
@@ -1053,6 +1053,7 @@
     lldb::SearchFilterSP  m_search_filter_sp;
     PathMappingList m_image_search_paths;
     std::auto_ptr<ClangASTContext> m_scratch_ast_context_ap;
+    std::auto_ptr<ClangASTSource> m_scratch_ast_source_ap;
     ClangPersistentVariables m_persistent_variables;      ///< These are the persistent variables associated with this process for the expression parser.
 
     SourceManager m_source_manager;

Modified: lldb/trunk/include/lldb/lldb-forward.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-forward.h?rev=144712&r1=144711&r2=144712&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-forward.h (original)
+++ lldb/trunk/include/lldb/lldb-forward.h Tue Nov 15 16:27:19 2011
@@ -41,6 +41,7 @@
 class   Broadcaster;
 class   CPPLanguageRuntime;
 class   ClangASTContext;
+class   ClangASTSource;
 class   ClangASTType;
 class   ClangNamespaceDecl;
 class   ClangExpression;

Modified: lldb/trunk/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=144712&r1=144711&r2=144712&view=diff
==============================================================================
--- lldb/trunk/source/Target/Target.cpp (original)
+++ lldb/trunk/source/Target/Target.cpp Tue Nov 15 16:27:19 2011
@@ -26,6 +26,7 @@
 #include "lldb/Core/StreamString.h"
 #include "lldb/Core/Timer.h"
 #include "lldb/Core/ValueObject.h"
+#include "lldb/Expression/ClangASTSource.h"
 #include "lldb/Expression/ClangUserExpression.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
@@ -171,6 +172,7 @@
     m_search_filter_sp.reset();
     m_image_search_paths.Clear(notify);
     m_scratch_ast_context_ap.reset();
+    m_scratch_ast_source_ap.reset();
     m_persistent_variables.Clear();
     m_stop_hooks.clear();
     m_stop_hook_next_id = 0;
@@ -794,6 +796,7 @@
 {
     m_images.Clear();
     m_scratch_ast_context_ap.reset();
+    m_scratch_ast_source_ap.reset();
     
     if (executable_sp.get())
     {
@@ -1329,7 +1332,13 @@
 {
     // Now see if we know the target triple, and if so, create our scratch AST context:
     if (m_scratch_ast_context_ap.get() == NULL && m_arch.IsValid())
+    {
         m_scratch_ast_context_ap.reset (new ClangASTContext(m_arch.GetTriple().str().c_str()));
+        m_scratch_ast_source_ap.reset (new ClangASTSource(GetSP()));
+        m_scratch_ast_source_ap->InstallASTContext(m_scratch_ast_context_ap->getASTContext());
+        llvm::OwningPtr<clang::ExternalASTSource> proxy_ast_source(m_scratch_ast_source_ap->CreateProxy());
+        m_scratch_ast_context_ap->SetExternalSource(proxy_ast_source);
+    }
     return m_scratch_ast_context_ap.get();
 }
 





More information about the lldb-commits mailing list