]> granicus.if.org Git - clang/commitdiff
added post-statement callback to CXXNewExpr and pre-statement callback to CXXDeleteExpr
authorAnton Yartsev <anton.yartsev@gmail.com>
Fri, 14 Dec 2012 19:48:34 +0000 (19:48 +0000)
committerAnton Yartsev <anton.yartsev@gmail.com>
Fri, 14 Dec 2012 19:48:34 +0000 (19:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170234 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/ExprEngine.cpp

index 5c91dd288fab52593bf16a7666b62553c99a0373..0f5fad1ac516066075c2dd16fcdd4cd37559cbfd 100644 (file)
@@ -780,21 +780,28 @@ void ExprEngine::Visit(const Stmt *S, ExplodedNode *Pred,
       break;
     }
 
-    case Stmt::CXXNewExprClass: {
-      Bldr.takeNodes(Pred);
-      const CXXNewExpr *NE = cast<CXXNewExpr>(S);
-      VisitCXXNewExpr(NE, Pred, Dst);
-      Bldr.addNodes(Dst);
-      break;
-    }
-
-    case Stmt::CXXDeleteExprClass: {
-      Bldr.takeNodes(Pred);
-      const CXXDeleteExpr *CDE = cast<CXXDeleteExpr>(S);
-      VisitCXXDeleteExpr(CDE, Pred, Dst);
-      Bldr.addNodes(Dst);
-      break;
-    }
+    case Stmt::CXXNewExprClass: {\r
+      Bldr.takeNodes(Pred);\r
+      ExplodedNodeSet PostVisit;\r
+      VisitCXXNewExpr(cast<CXXNewExpr>(S), Pred, PostVisit);\r
+      getCheckerManager().runCheckersForPostStmt(Dst, PostVisit, S, *this);\r
+      Bldr.addNodes(Dst);\r
+      break;\r
+    }\r
+\r
+    case Stmt::CXXDeleteExprClass: {\r
+      Bldr.takeNodes(Pred);\r
+      ExplodedNodeSet PreVisit;\r
+      const CXXDeleteExpr *CDE = cast<CXXDeleteExpr>(S);\r
+      getCheckerManager().runCheckersForPreStmt(PreVisit, Pred, S, *this);\r
+\r
+      for (ExplodedNodeSet::iterator i = PreVisit.begin(), \r
+                                     e = PreVisit.end(); i != e ; ++i)\r
+        VisitCXXDeleteExpr(CDE, *i, Dst);\r
+\r
+      Bldr.addNodes(Dst);\r
+      break;\r
+    }\r
       // FIXME: ChooseExpr is really a constant.  We need to fix
       //        the CFG do not model them as explicit control-flow.