aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-11-25 22:23:25 +0000
committerTed Kremenek <kremenek@apple.com>2009-11-25 22:23:25 +0000
commit66078610be5e4319de02efa283b07887c73c2e27 (patch)
tree0f92f6a284cfe19a0f76bd3dec629cce1f803627
parentd593eb93329ebea1b50dd32221116240eb1e1eac (diff)
Add post-visit Checker support in GRExprEngine for BlockExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89890 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Analysis/PathSensitive/CheckerVisitor.def1
-rw-r--r--lib/Analysis/GRExprEngine.cpp8
2 files changed, 8 insertions, 1 deletions
diff --git a/include/clang/Analysis/PathSensitive/CheckerVisitor.def b/include/clang/Analysis/PathSensitive/CheckerVisitor.def
index 27c316897b..4144d1a0a7 100644
--- a/include/clang/Analysis/PathSensitive/CheckerVisitor.def
+++ b/include/clang/Analysis/PathSensitive/CheckerVisitor.def
@@ -28,6 +28,7 @@ PREVISIT(ObjCMessageExpr)
PREVISIT(ReturnStmt)
POSTVISIT(CallExpr)
+POSTVISIT(BlockExpr)
POSTVISIT(BinaryOperator)
#undef PREVISIT
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index a0040f4e87..cb3f68b41d 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -1103,10 +1103,16 @@ void GRExprEngine::VisitLogicalExpr(BinaryOperator* B, ExplodedNode* Pred,
void GRExprEngine::VisitBlockExpr(BlockExpr *BE, ExplodedNode *Pred,
ExplodedNodeSet &Dst) {
+
+ ExplodedNodeSet Tmp;
+
CanQualType T = getContext().getCanonicalType(BE->getType());
SVal V = ValMgr.getBlockPointer(BE->getBlockDecl(), T);
- MakeNode(Dst, BE, Pred, GetState(Pred)->BindExpr(BE, V),
+ MakeNode(Tmp, BE, Pred, GetState(Pred)->BindExpr(BE, V),
ProgramPoint::PostLValueKind);
+
+ // Post-visit the BlockExpr.
+ CheckerVisit(BE, Dst, Tmp, false);
}
void GRExprEngine::VisitDeclRefExpr(DeclRefExpr *Ex, ExplodedNode *Pred,