diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-08-20 17:08:29 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-08-20 17:08:29 +0000 |
commit | df9cdf8fce5bb43b335994f946f7c8e3a3bca7fa (patch) | |
tree | 31e392c4c971a3cefac8648ff07628609e75cc3e /lib/Analysis/GRState.cpp | |
parent | 4f7b483b7e9ba0170a8c1cd3d8be3e972b31fe36 (diff) |
Patch by Zhongxing Xu:
This patch moves some code in GRStateManager::RemoveDeadBindings() to EnvironmentManager::RemoveDeadBindings().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55064 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRState.cpp')
-rw-r--r-- | lib/Analysis/GRState.cpp | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/lib/Analysis/GRState.cpp b/lib/Analysis/GRState.cpp index c9494fe7ea..1cee484357 100644 --- a/lib/Analysis/GRState.cpp +++ b/lib/Analysis/GRState.cpp @@ -88,40 +88,8 @@ GRStateManager::RemoveDeadBindings(const GRState* St, Stmt* Loc, GRState NewSt = *St; - // FIXME: Put this in environment. - // Clean up the environment. - - // Drop bindings for subexpressions. - NewSt.Env = EnvMgr.RemoveSubExprBindings(NewSt.Env); - - // Iterate over the block-expr bindings. - - for (GRState::beb_iterator I = St->beb_begin(), E = St->beb_end(); - I!=E ; ++I) { - Expr* BlkExpr = I.getKey(); - - if (Liveness.isLive(Loc, BlkExpr)) { - RVal X = I.getData(); - - if (isa<lval::DeclVal>(X)) { - lval::DeclVal LV = cast<lval::DeclVal>(X); - DRoots.push_back(LV.getDecl()); - } - - for (RVal::symbol_iterator SI = X.symbol_begin(), SE = X.symbol_end(); - SI != SE; ++SI) { - LSymbols.insert(*SI); - } - } - else { - RVal X = I.getData(); - - if (X.isUndef() && cast<UndefinedVal>(X).getData()) - continue; - - NewSt.Env = EnvMgr.RemoveBlkExpr(NewSt.Env, BlkExpr); - } - } + NewSt.Env = EnvMgr.RemoveDeadBindings(NewSt.Env, Loc, Liveness, + DRoots, LSymbols); // Clean up the store. DSymbols.clear(); |