aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/GRState.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/GRState.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/GRState.cpp')
-rw-r--r--lib/Analysis/GRState.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/Analysis/GRState.cpp b/lib/Analysis/GRState.cpp
index 8e49ebb63d..ea6f7a03d6 100644
--- a/lib/Analysis/GRState.cpp
+++ b/lib/Analysis/GRState.cpp
@@ -34,9 +34,8 @@ GRStateManager::~GRStateManager() {
const GRState*
GRStateManager::RemoveDeadBindings(const GRState* state, Stmt* Loc,
- const LiveVariables& Liveness,
- DeadSymbolsTy& DSymbols) {
-
+ SymbolReaper& SymReaper) {
+
// This code essentially performs a "mark-and-sweep" of the VariableBindings.
// The roots are any Block-level exprs and Decls that our liveness algorithm
// tells us are live. We then see what Decls they may reference, and keep
@@ -44,19 +43,17 @@ GRStateManager::RemoveDeadBindings(const GRState* state, Stmt* Loc,
// frequency of which this method is called should be experimented with
// for optimum performance.
llvm::SmallVector<const MemRegion*, 10> RegionRoots;
- StoreManager::LiveSymbolsTy LSymbols;
GRState NewState = *state;
- NewState.Env = EnvMgr.RemoveDeadBindings(NewState.Env, Loc, Liveness,
- RegionRoots, LSymbols);
+ NewState.Env = EnvMgr.RemoveDeadBindings(NewState.Env, Loc, SymReaper,
+ RegionRoots);
// Clean up the store.
- DSymbols.clear();
- NewState.St = StoreMgr->RemoveDeadBindings(&NewState, Loc, Liveness,
- RegionRoots, LSymbols, DSymbols);
+ NewState.St = StoreMgr->RemoveDeadBindings(&NewState, Loc, SymReaper,
+ RegionRoots);
return ConstraintMgr->RemoveDeadBindings(getPersistentState(NewState),
- LSymbols, DSymbols);
+ SymReaper);
}
const GRState* GRStateManager::Unbind(const GRState* St, Loc LV) {