diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/Expression/ClangUserExpression.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
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 |