[cfe-commits] r89890 - in /cfe/trunk: include/clang/Analysis/PathSensitive/CheckerVisitor.def lib/Analysis/GRExprEngine.cpp

Ted Kremenek kremenek at apple.com
Wed Nov 25 14:23:25 PST 2009


Author: kremenek
Date: Wed Nov 25 16:23:25 2009
New Revision: 89890

URL: http://llvm.org/viewvc/llvm-project?rev=89890&view=rev
Log:
Add post-visit Checker support in GRExprEngine for BlockExpr.

Modified:
    cfe/trunk/include/clang/Analysis/PathSensitive/CheckerVisitor.def
    cfe/trunk/lib/Analysis/GRExprEngine.cpp

Modified: cfe/trunk/include/clang/Analysis/PathSensitive/CheckerVisitor.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/CheckerVisitor.def?rev=89890&r1=89889&r2=89890&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/CheckerVisitor.def (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/CheckerVisitor.def Wed Nov 25 16:23:25 2009
@@ -28,6 +28,7 @@
 PREVISIT(ReturnStmt)
 
 POSTVISIT(CallExpr)
+POSTVISIT(BlockExpr)
 POSTVISIT(BinaryOperator)
 
 #undef PREVISIT

Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=89890&r1=89889&r2=89890&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Wed Nov 25 16:23:25 2009
@@ -1103,10 +1103,16 @@
 
 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,





More information about the cfe-commits mailing list