From 9973231fb042cc0b03b9246eb6b6a7df95c4ff82 Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Tue, 29 Nov 2011 00:42:02 +0000 Subject: Changed ClangASTImporter to allow finer-grained management of what allocations remain after an expression finishes executing. This saves around 2.5KiB per expression for simple expressions. llvm-svn: 145342 --- lldb/source/Expression/ClangASTSource.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'lldb/source/Expression/ClangASTSource.cpp') diff --git a/lldb/source/Expression/ClangASTSource.cpp b/lldb/source/Expression/ClangASTSource.cpp index 4c6ba7eedc7..5f3c8b15b30 100644 --- a/lldb/source/Expression/ClangASTSource.cpp +++ b/lldb/source/Expression/ClangASTSource.cpp @@ -24,7 +24,20 @@ using namespace lldb_private; ClangASTSource::~ClangASTSource() { - m_ast_importer->PurgeMaps(m_ast_context); + m_ast_importer->ForgetDestination(m_ast_context); + + ClangASTContext *scratch_clang_ast_context = m_target->GetScratchClangASTContext(); + + if (!scratch_clang_ast_context) + return; + + clang::ASTContext *scratch_ast_context = scratch_clang_ast_context->getASTContext(); + + if (!scratch_ast_context) + return; + + if (m_ast_context != scratch_ast_context) + m_ast_importer->ForgetSource(scratch_ast_context, m_ast_context); } void -- cgit v1.2.3