]> granicus.if.org Git - clang/commitdiff
Add post-visit Checker support in GRExprEngine for BlockExpr.
authorTed Kremenek <kremenek@apple.com>
Wed, 25 Nov 2009 22:23:25 +0000 (22:23 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 25 Nov 2009 22:23:25 +0000 (22:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89890 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/PathSensitive/CheckerVisitor.def
lib/Analysis/GRExprEngine.cpp

index 27c316897bcd60483bb9ff8afb65312c2c4214d3..4144d1a0a7345623dd82db5d0c62b82b0cff6758 100644 (file)
@@ -28,6 +28,7 @@ PREVISIT(ObjCMessageExpr)
 PREVISIT(ReturnStmt)
 
 POSTVISIT(CallExpr)
+POSTVISIT(BlockExpr)
 POSTVISIT(BinaryOperator)
 
 #undef PREVISIT
index a0040f4e87421a808269e16cb5587fc085a3393a..cb3f68b41df558b13b240a5c97a3eaa39039c8e2 100644 (file)
@@ -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,