summaryrefslogtreecommitdiffstats
path: root/clang/lib/Checker/GRCXXExprEngine.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2010-11-20 06:53:12 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2010-11-20 06:53:12 +0000
commit2c966716ff40c9f1e2f8c128415d1567b1525c48 (patch)
tree9bd4cf3f7f46a028d18a54a7e3867dd0eec01adc /clang/lib/Checker/GRCXXExprEngine.cpp
parentada75c5ad10b01dae20169f18b329a7860052d74 (diff)
downloadbcm5719-llvm-2c966716ff40c9f1e2f8c128415d1567b1525c48.tar.gz
bcm5719-llvm-2c966716ff40c9f1e2f8c128415d1567b1525c48.zip
Handle CFGAutomaticObjDtor.
llvm-svn: 119897
Diffstat (limited to 'clang/lib/Checker/GRCXXExprEngine.cpp')
-rw-r--r--clang/lib/Checker/GRCXXExprEngine.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/lib/Checker/GRCXXExprEngine.cpp b/clang/lib/Checker/GRCXXExprEngine.cpp
index 642c26e2408..ecc1490ce6a 100644
--- a/clang/lib/Checker/GRCXXExprEngine.cpp
+++ b/clang/lib/Checker/GRCXXExprEngine.cpp
@@ -143,6 +143,30 @@ void GRExprEngine::VisitCXXConstructExpr(const CXXConstructExpr *E,
}
}
+void GRExprEngine::VisitCXXDestructor(const CXXDestructorDecl *DD,
+ const MemRegion *Dest,
+ const Stmt *S,
+ ExplodedNode *Pred,
+ ExplodedNodeSet &Dst) {
+ if (!(DD->isThisDeclarationADefinition() && AMgr.shouldInlineCall()))
+ return;
+ // Create the context for 'this' region.
+ const StackFrameContext *SFC = AMgr.getStackFrame(DD,
+ Pred->getLocationContext(),
+ S, Builder->getBlock(),
+ Builder->getIndex());
+
+ const CXXThisRegion *ThisR = getCXXThisRegion(DD->getParent(), SFC);
+
+ CallEnter PP(S, SFC->getAnalysisContext(), Pred->getLocationContext());
+
+ const GRState *state = Pred->getState();
+ state = state->bindLoc(loc::MemRegionVal(ThisR), loc::MemRegionVal(Dest));
+ ExplodedNode *N = Builder->generateNode(PP, state, Pred);
+ if (N)
+ Dst.Add(N);
+}
+
void GRExprEngine::VisitCXXMemberCallExpr(const CXXMemberCallExpr *MCE,
ExplodedNode *Pred,
ExplodedNodeSet &Dst) {
OpenPOWER on IntegriCloud