summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2011-11-29 00:42:02 +0000
committerSean Callanan <scallanan@apple.com>2011-11-29 00:42:02 +0000
commit9973231fb042cc0b03b9246eb6b6a7df95c4ff82 (patch)
treedf9fb2cdd1851fc84857127974866c87cc2010f1 /lldb/source/Expression
parentfe2d028ab1563fc48357f303f75949534607b43d (diff)
downloadbcm5719-llvm-9973231fb042cc0b03b9246eb6b6a7df95c4ff82.tar.gz
bcm5719-llvm-9973231fb042cc0b03b9246eb6b6a7df95c4ff82.zip
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
Diffstat (limited to 'lldb/source/Expression')
-rw-r--r--lldb/source/Expression/ClangASTSource.cpp15
1 files changed, 14 insertions, 1 deletions
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
OpenPOWER on IntegriCloud