[cfe-commits] r65080 - in /cfe/trunk: include/clang/Analysis/PathSensitive/GRCoreEngine.h lib/Analysis/GRCoreEngine.cpp

Ted Kremenek kremenek at apple.com
Thu Feb 19 15:45:29 PST 2009


Author: kremenek
Date: Thu Feb 19 17:45:28 2009
New Revision: 65080

URL: http://llvm.org/viewvc/llvm-project?rev=65080&view=rev
Log:
Added a new method to GRStmtNodeBuilder to build nodes using an arbitrary
PostStmt program point. This allows clients to pass in PostStmtCustom program
points.

Modified:
    cfe/trunk/include/clang/Analysis/PathSensitive/GRCoreEngine.h
    cfe/trunk/lib/Analysis/GRCoreEngine.cpp

Modified: cfe/trunk/include/clang/Analysis/PathSensitive/GRCoreEngine.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/GRCoreEngine.h?rev=65080&r1=65079&r2=65080&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRCoreEngine.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRCoreEngine.h Thu Feb 19 17:45:28 2009
@@ -142,6 +142,9 @@
   }  
     
   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 @@
     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;

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

==============================================================================
--- cfe/trunk/lib/Analysis/GRCoreEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRCoreEngine.cpp Thu Feb 19 17:45:28 2009
@@ -368,7 +368,7 @@
     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 @@
 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);





More information about the cfe-commits mailing list