diff options
-rw-r--r-- | include/lldb/Expression/ClangUserExpression.h | 2 | ||||
-rw-r--r-- | include/lldb/lldb-forward.h | 1 | ||||
-rw-r--r-- | source/Expression/ClangUserExpression.cpp | 11 |
3 files changed, 10 insertions, 4 deletions
diff --git a/include/lldb/Expression/ClangUserExpression.h b/include/lldb/Expression/ClangUserExpression.h index 279ed75b9..6f69cf047 100644 --- a/include/lldb/Expression/ClangUserExpression.h +++ b/include/lldb/Expression/ClangUserExpression.h @@ -325,6 +325,8 @@ private: std::auto_ptr<ClangExpressionVariableList> m_local_variables; ///< The local expression variables, if the expression is DWARF. std::auto_ptr<ProcessDataAllocator> m_data_allocator; ///< The allocator that the parser uses to place strings for use by JIT-compiled code. + std::auto_ptr<ASTResultSynthesizer> m_result_synthesizer; ///< The result synthesizer, if one is needed. + bool m_cplusplus; ///< True if the expression is compiled as a C++ member function (true if it was parsed when exe_ctx was in a C++ method). bool m_objectivec; ///< True if the expression is compiled as an Objective-C method (true if it was parsed when exe_ctx was in an Objective-C method). bool m_needs_object_ptr; ///< True if "this" or "self" must be looked up and passed in. False if the expression doesn't really use them and they can be NULL. diff --git a/include/lldb/lldb-forward.h b/include/lldb/lldb-forward.h index b31a4ae62..90987e7e9 100644 --- a/include/lldb/lldb-forward.h +++ b/include/lldb/lldb-forward.h @@ -24,6 +24,7 @@ class AddressRange; class AddressResolver; class ArchSpec; class Args; +class ASTResultSynthesizer; class Baton; class Block; class Breakpoint; diff --git a/source/Expression/ClangUserExpression.cpp b/source/Expression/ClangUserExpression.cpp index b4f4901a1..9ded61adf 100644 --- a/source/Expression/ClangUserExpression.cpp +++ b/source/Expression/ClangUserExpression.cpp @@ -72,10 +72,13 @@ ClangUserExpression::ASTTransformer (clang::ASTConsumer *passthrough) if (!clang_ast_context) return NULL; - return new ASTResultSynthesizer(passthrough, - m_desired_type, - *m_target->GetScratchClangASTContext()->getASTContext(), - m_target->GetPersistentVariables()); + if (!m_result_synthesizer.get()) + m_result_synthesizer.reset(new ASTResultSynthesizer(passthrough, + m_desired_type, + *m_target->GetScratchClangASTContext()->getASTContext(), + m_target->GetPersistentVariables())); + + return m_result_synthesizer.get(); } void |