[cfe-commits] r89882 - /cfe/trunk/lib/Analysis/GRExprEngine.cpp

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


Author: kremenek
Date: Wed Nov 25 15:40:22 2009
New Revision: 89882

URL: http://llvm.org/viewvc/llvm-project?rev=89882&view=rev
Log:
When dispatching to Checker objects in GRExprEngine::CheckerVisit(),
only stop processing the checkers after all the nodes for a current
check have been processed.  This (I believe) handles the case where
PredSet (the input nodes) contains more than one node due to state
bifurcation.  Zhongxing: can you review this?

Modified:
    cfe/trunk/lib/Analysis/GRExprEngine.cpp

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

==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Wed Nov 25 15:40:22 2009
@@ -118,6 +118,7 @@
 
   ExplodedNodeSet Tmp;
   ExplodedNodeSet *PrevSet = &Src;
+  bool stopProcessingAfterCurrentChecker = false;
 
   for (CheckersOrdered::iterator I=Checkers.begin(),E=Checkers.end(); I!=E; ++I)
   {
@@ -127,20 +128,27 @@
     CurrSet->clear();
     void *tag = I->first;
     Checker *checker = I->second;
-
+    
     for (ExplodedNodeSet::iterator NI = PrevSet->begin(), NE = PrevSet->end();
          NI != NE; ++NI) {
       // FIXME: Halting evaluation of the checkers is something we may
-      // not support later.  The design is still evolving.
+      // not support later.  The design is still evolving.      
       if (checker->GR_Visit(*CurrSet, *Builder, *this, S, *NI,
                             tag, isPrevisit)) {
         if (CurrSet != &Dst)
           Dst.insert(*CurrSet);
-        return true;
+
+        stopProcessingAfterCurrentChecker = true;
+        continue;
       }
+      assert(stopProcessingAfterCurrentChecker == false &&
+             "Inconsistent setting of 'stopProcessingAfterCurrentChecker'");
     }
+    
+    if (stopProcessingAfterCurrentChecker)
+      return true;
 
-    // Update which NodeSet is the current one.
+    // Continue on to the next checker.  Update the current NodeSet.
     PrevSet = CurrSet;
   }
 





More information about the cfe-commits mailing list