diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-02-09 01:27:33 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-02-09 01:27:33 +0000 |
commit | a40f8ebc83735aa7f930d0772817725e958bfbd6 (patch) | |
tree | 0601f79406263e1183f1709b0bf68b94df31da0d /clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp | |
parent | a6282255353572c86372f7acb7e55df959666e0a (diff) | |
download | bcm5719-llvm-a40f8ebc83735aa7f930d0772817725e958bfbd6.tar.gz bcm5719-llvm-a40f8ebc83735aa7f930d0772817725e958bfbd6.zip |
static analyzer: Further reduce the analyzer's memory usage when analyzing sqlite3 by 7-10% by recylcing "uninteresting" ExplodedNodes.
The optimization involves eagerly pruning ExplodedNodes from the ExplodedGraph that contain
practically no difference between the predecessor and successor nodes. For example, if
the state is different between a predecessor and a node, the node is left in. Only for
the 'environment' component of the state do we not care if the ExplodedNodes are different.
This paves the way for future optimizations where we can reclaim the environment objects.
llvm-svn: 125154
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp index cadbca6b3d0..e2ad17e590b 100644 --- a/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp @@ -338,6 +338,11 @@ ExprEngine::ExprEngine(AnalysisManager &mgr, TransferFuncs *tf) // FIXME: Eventually remove the TF object entirely. TF->RegisterChecks(*this); TF->RegisterPrinters(getStateManager().Printers); + + if (mgr.shouldEagerlyTrimExplodedGraph()) { + // Enable eager node reclaimation when constructing the ExplodedGraph. + G.enableNodeReclamation(); + } } ExprEngine::~ExprEngine() { @@ -573,6 +578,8 @@ void ExprEngine::processCFGElement(const CFGElement E, } void ExprEngine::ProcessStmt(const CFGStmt S, StmtNodeBuilder& builder) { + // Reclaim any unnecessary nodes in the ExplodedGraph. + G.reclaimRecentlyAllocatedNodes(); // Recycle any unused states in the GRStateManager. StateMgr.recycleUnusedStates(); |