summaryrefslogtreecommitdiffstats
path: root/clang/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
commit9516feac3615013fbc105d6579ce49e4b20524dd (patch)
treeea1ddf542f218186d8001735a143e7c1c299592e /clang/lib/Checker/GRExprEngine.cpp
parent8fa1e7eec4d0a75dbe90c76d22562a933f56c1bd (diff)
downloadbcm5719-llvm-9516feac3615013fbc105d6579ce49e4b20524dd.tar.gz
bcm5719-llvm-9516feac3615013fbc105d6579ce49e4b20524dd.zip
Move the dead bindings removal logic from CallInliner to GRExprEngine::ProcessCallExit().
llvm-svn: 97129
Diffstat (limited to 'clang/lib/Checker/GRExprEngine.cpp')
-rw-r--r--clang/lib/Checker/GRExprEngine.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/clang/lib/Checker/GRExprEngine.cpp b/clang/lib/Checker/GRExprEngine.cpp
index 695ed02e22f..30b82f70ce0 100644
--- a/clang/lib/Checker/GRExprEngine.cpp
+++ b/clang/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);
}
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud