aboutsummaryrefslogtreecommitdiff
path: root/lib/Checker/GRExprEngine.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2010-02-25 07:36:34 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2010-02-25 07:36:34 +0000
commit9a9f627f3bc0b0eb948a8b95806383afd72c374e (patch)
tree7adfba2d7f9a254d405362203fc11feabfd60e7d /lib/Checker/GRExprEngine.cpp
parent23a370f9455698e5501101aea7ad8a884a8d4556 (diff)
Move the dead bindings removal logic from CallInliner to GRExprEngine::ProcessCallExit().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97129 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/GRExprEngine.cpp')
-rw-r--r--lib/Checker/GRExprEngine.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/Checker/GRExprEngine.cpp b/lib/Checker/GRExprEngine.cpp
index 695ed02e22..30b82f70ce 100644
--- a/lib/Checker/GRExprEngine.cpp
+++ b/lib/Checker/GRExprEngine.cpp
@@ -1305,7 +1305,21 @@ void GRExprEngine::ProcessCallEnter(GRCallEnterNodeBuilder &B) {
}
void GRExprEngine::ProcessCallExit(GRCallExitNodeBuilder &B) {
- B.GenerateNode();
+ const GRState *state = B.getState();
+ const ExplodedNode *Pred = B.getPredecessor();
+ const StackFrameContext *LocCtx =
+ cast<StackFrameContext>(Pred->getLocationContext());
+ const StackFrameContext *ParentSF =
+ cast<StackFrameContext>(LocCtx->getParent());
+
+ SymbolReaper SymReaper(*ParentSF->getLiveVariables(), getSymbolManager(),
+ ParentSF);
+ const Stmt *CE = LocCtx->getCallSite();
+
+ state = getStateManager().RemoveDeadBindings(state, const_cast<Stmt*>(CE),
+ SymReaper);
+
+ B.GenerateNode(state);
}
//===----------------------------------------------------------------------===//