[Lldb-commits] [lldb] r136758 - /lldb/trunk/source/Target/Target.cpp

Greg Clayton gclayton at apple.com
Tue Aug 2 18:23:56 PDT 2011


Author: gclayton
Date: Tue Aug  2 20:23:55 2011
New Revision: 136758

URL: http://llvm.org/viewvc/llvm-project?rev=136758&view=rev
Log:
Create the scratch AST context in the accessor function, not
only when the executable is set.


Modified:
    lldb/trunk/source/Target/Target.cpp

Modified: lldb/trunk/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=136758&r1=136757&r2=136758&view=diff
==============================================================================
--- lldb/trunk/source/Target/Target.cpp (original)
+++ lldb/trunk/source/Target/Target.cpp Tue Aug  2 20:23:55 2011
@@ -465,11 +465,6 @@
             }
         }
         
-        // Now see if we know the target triple, and if so, create our scratch AST context:
-        if (m_arch.IsValid())
-        {
-            m_scratch_ast_context_ap.reset (new ClangASTContext(m_arch.GetTriple().str().c_str()));
-        }
     }
 
     UpdateInstanceName();
@@ -911,6 +906,9 @@
 ClangASTContext *
 Target::GetScratchClangASTContext()
 {
+    // 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()));
     return m_scratch_ast_context_ap.get();
 }
 





More information about the lldb-commits mailing list