]> granicus.if.org Git - clang/commitdiff
Added a new method to GRStmtNodeBuilder to build nodes using an arbitrary
authorTed Kremenek <kremenek@apple.com>
Thu, 19 Feb 2009 23:45:28 +0000 (23:45 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 19 Feb 2009 23:45:28 +0000 (23:45 +0000)
PostStmt program point. This allows clients to pass in PostStmtCustom program
points.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65080 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/PathSensitive/GRCoreEngine.h
lib/Analysis/GRCoreEngine.cpp

index d656bc7cfca0acf4d13625d669a5e58690d09975..5bd76a034b393352a22fbe3e9b34251612c77807 100644 (file)
@@ -141,6 +141,9 @@ public:
     return getBlockCounter().getNumVisited(B.getBlockID());
   }  
     
+  ExplodedNodeImpl*
+  generateNodeImpl(PostStmt PP, const void* State, ExplodedNodeImpl* Pred);
+  
   ExplodedNodeImpl*
   generateNodeImpl(Stmt* S, const void* State, ExplodedNodeImpl* Pred,
                    ProgramPoint::Kind K = ProgramPoint::PostStmtKind);
@@ -193,6 +196,10 @@ public:
     return static_cast<NodeTy*>(NB.getLastNode());
   }
   
+  NodeTy* generateNode(PostStmt PP, const StateTy* St, NodeTy* Pred) {
+    return static_cast<NodeTy*>(NB.generateNodeImpl(PP, St, Pred));
+  }
+  
   NodeTy* generateNode(Stmt* S, const StateTy* St, NodeTy* Pred,
                        ProgramPoint::Kind K) {
     HasGeneratedNode = true;
index 42ea41382eb29bab24594775f7121be6efe03a0a..28f1a317c3d8e5f62acdd227fbc305521045c918 100644 (file)
@@ -368,7 +368,7 @@ void GRStmtNodeBuilderImpl::GenerateAutoTransition(ExplodedNodeImpl* N) {
     Eng.WList->Enqueue(Succ, B, Idx+1);
 }
 
-static inline ProgramPoint GetPostLoc(Stmt* S, ProgramPoint::Kind K) {
+static inline PostStmt GetPostLoc(Stmt* S, ProgramPoint::Kind K) {
   switch (K) {
     default:
       assert(false && "Invalid PostXXXKind.");
@@ -403,10 +403,13 @@ ExplodedNodeImpl*
 GRStmtNodeBuilderImpl::generateNodeImpl(Stmt* S, const void* State,
                                         ExplodedNodeImpl* Pred,
                                         ProgramPoint::Kind K) {
-  
+  return generateNodeImpl(GetPostLoc(S, K), State, Pred); 
+}
+
+ExplodedNodeImpl*
+GRStmtNodeBuilderImpl::generateNodeImpl(PostStmt Loc, const void* State,
+                                        ExplodedNodeImpl* Pred) {  
   bool IsNew;
-  ProgramPoint Loc = GetPostLoc(S, K);
-  
   ExplodedNodeImpl* N = Eng.G->getNodeImpl(Loc, State, &IsNew);
   N->addPredecessor(Pred);
   Deferred.erase(Pred);