diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-02-25 07:36:34 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-02-25 07:36:34 +0000 |
commit | 9516feac3615013fbc105d6579ce49e4b20524dd (patch) | |
tree | ea1ddf542f218186d8001735a143e7c1c299592e /clang/lib/Checker/GRExprEngine.cpp | |
parent | 8fa1e7eec4d0a75dbe90c76d22562a933f56c1bd (diff) | |
download | bcm5719-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.cpp | 16 |
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); } //===----------------------------------------------------------------------===// |