aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/Environment.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/Environment.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/Environment.cpp')
-rw-r--r--lib/Analysis/Environment.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/Analysis/Environment.cpp b/lib/Analysis/Environment.cpp
index 5f9e97eb0a..c4ed349906 100644
--- a/lib/Analysis/Environment.cpp
+++ b/lib/Analysis/Environment.cpp
@@ -108,9 +108,8 @@ Environment EnvironmentManager::BindExpr(const Environment& Env, Stmt* E,SVal V,
Environment
EnvironmentManager::RemoveDeadBindings(Environment Env, Stmt* Loc,
- const LiveVariables& Liveness,
- llvm::SmallVectorImpl<const MemRegion*>& DRoots,
- StoreManager::LiveSymbolsTy& LSymbols) {
+ SymbolReaper& SymReaper,
+ llvm::SmallVectorImpl<const MemRegion*>& DRoots) {
// Drop bindings for subexpressions.
Env = RemoveSubExprBindings(Env);
@@ -120,19 +119,18 @@ EnvironmentManager::RemoveDeadBindings(Environment Env, Stmt* Loc,
I != E; ++I) {
Stmt* BlkExpr = I.getKey();
- if (Liveness.isLive(Loc, BlkExpr)) {
+ if (SymReaper.isLive(Loc, BlkExpr)) {
SVal X = I.getData();
// If the block expr's value is a memory region, then mark that region.
if (isa<loc::MemRegionVal>(X))
DRoots.push_back(cast<loc::MemRegionVal>(X).getRegion());
-
// Mark all symbols in the block expr's value.
for (SVal::symbol_iterator SI = X.symbol_begin(), SE = X.symbol_end();
- SI != SE; ++SI) {
- LSymbols.insert(*SI);
- }
+ SI != SE; ++SI)
+ SymReaper.markLive(*SI);
+
} else {
// The block expr is dead.
SVal X = I.getData();