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

Ted Kremenek kremenek at apple.com
Tue Mar 4 15:39:44 PST 2008


Author: kremenek
Date: Tue Mar  4 17:39:43 2008
New Revision: 47919

URL: http://llvm.org/viewvc/llvm-project?rev=47919&view=rev
Log:
Moved implementation of GRExprEngine::Nodify into GRStmtNodeBuilder.  This will
allow us to pass the builder to plug-in transfer functions and allow those
functions to create intermediate nodes.

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

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

==============================================================================
--- cfe/trunk/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/Analysis/GRExprEngine.cpp Tue Mar  4 17:39:43 2008
@@ -433,30 +433,6 @@
   Builder = NULL;
 }
 
-GRExprEngine::NodeTy*
-GRExprEngine::Nodify(NodeSet& Dst, Stmt* S, NodeTy* Pred, ValueState* St) {
- 
-  // If the state hasn't changed, don't generate a new node.
-  if (St == Pred->getState()) {
-    Dst.Add(Pred);
-    return NULL;
-  }
-  
-  NodeTy* N = Builder->generateNode(S, St, Pred);
-  Dst.Add(N);
-  
-  return N;
-}
-
-#if 0
-void GRExprEngine::Nodify(NodeSet& Dst, Stmt* S, NodeTy* Pred,
-                         const ValueState::BufferTy& SB) {
-  
-  for (ValueState::BufferTy::const_iterator I=SB.begin(), E=SB.end(); I!=E; ++I)
-    Nodify(Dst, S, Pred, *I);
-}
-#endif
-
 void GRExprEngine::VisitDeclRefExpr(DeclRefExpr* D, NodeTy* Pred, NodeSet& Dst){
 
   if (D != CurrentStmt) {

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=47919&r1=47918&r2=47919&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRCoreEngine.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRCoreEngine.h Tue Mar  4 17:39:43 2008
@@ -184,7 +184,22 @@
   NodeTy* generateNode(Stmt* S, StateTy State) {
     void *state = GRTrait<StateTy>::toPtr(State);
     return static_cast<NodeTy*>(NB.generateNodeImpl(S, state));    
-  }  
+  }
+  
+  NodeTy* Nodify(ExplodedNodeSet<NodeTy> Dst, Stmt* S,
+                 NodeTy* Pred, StateTy St) {
+    
+    // If the state hasn't changed, don't generate a new node.
+    if (St == Pred->getState()) {
+      Dst.Add(Pred);
+      return NULL;
+    }
+    
+    NodeTy* N = generateNode(S, St, Pred);
+    Dst.Add(N);
+    return N;
+  }
+  
 };
   
 class GRBranchNodeBuilderImpl {

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

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h Tue Mar  4 17:39:43 2008
@@ -320,7 +320,10 @@
   ValueState* AssumeSymInt(ValueState* St, bool Assumption,
                            const SymIntConstraint& C, bool& isFeasible);
   
-  NodeTy* Nodify(NodeSet& Dst, Stmt* S, NodeTy* Pred, ValueState* St);
+  NodeTy* Nodify(NodeSet& Dst, Stmt* S, NodeTy* Pred, ValueState* St) {
+    assert (Builder && "GRStmtNodeBuilder not present.");
+    return Builder->Nodify(Dst, S, Pred, St);
+  }
   
 #if 0
   /// Nodify - This version of Nodify is used to batch process a set of states.





More information about the cfe-commits mailing list