aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/GRExprEngine.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-01-21 22:26:05 +0000
committerTed Kremenek <kremenek@apple.com>2009-01-21 22:26:05 +0000
commit241677a13cc46647a8f5098b3e3239bd9480dca2 (patch)
tree13849c05ba12762305e40038907d2672d1d9a65d /lib/Analysis/GRExprEngine.cpp
parentee0af74d1e0990c7b66d32657f3e4e54b8691552 (diff)
Static Analyzer: Replace LiveSymbols/DeadSymbols sets with a new object called "SymbolReaper". Right now it just consolidates the two and cleans up some client code, but shortly it will be used to enable "lazy computation" of live symbols for use with RegionStore.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62722 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRExprEngine.cpp')
-rw-r--r--lib/Analysis/GRExprEngine.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index 80215f34e8..6a7f86b14b 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -211,18 +211,17 @@ void GRExprEngine::ProcessStmt(Stmt* S, StmtNodeBuilder& builder) {
if (BatchAuditor)
Builder->setAuditor(BatchAuditor.get());
+
// Create the cleaned state.
- if (PurgeDead)
- CleanedState = StateMgr.RemoveDeadBindings(EntryNode->getState(),
- CurrentStmt,
- Liveness, DeadSymbols);
- else
- CleanedState = EntryNode->getState();
-
+ SymbolReaper SymReaper(Liveness, SymMgr);
+ CleanedState = PurgeDead ? StateMgr.RemoveDeadBindings(EntryNode->getState(),
+ CurrentStmt, SymReaper)
+ : EntryNode->getState();
+
// Process any special transfer function for dead symbols.
NodeSet Tmp;
- if (DeadSymbols.empty())
+ if (!SymReaper.hasDeadSymbols())
Tmp.Add(EntryNode);
else {
SaveAndRestore<bool> OldSink(Builder->BuildSinks);
@@ -232,7 +231,7 @@ void GRExprEngine::ProcessStmt(Stmt* S, StmtNodeBuilder& builder) {
Builder->PurgingDeadSymbols = true;
getTF().EvalDeadSymbols(Tmp, *this, *Builder, EntryNode, S,
- CleanedState, DeadSymbols);
+ CleanedState, SymReaper);
if (!Builder->BuildSinks && !Builder->HasGeneratedNode)
Tmp.Add(EntryNode);