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

Ted Kremenek kremenek at apple.com
Tue Jun 29 14:58:54 PDT 2010


Author: kremenek
Date: Tue Jun 29 16:58:54 2010
New Revision: 107209

URL: http://llvm.org/viewvc/llvm-project?rev=107209&view=rev
Log:
Tweaker Checker::VisitEndAnalysis to have 'hasWorkRemaining' also
be true if some paths were aborted because they exceeded
the maximum loop unrolling count.

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

Modified: cfe/trunk/include/clang/Checker/PathSensitive/GRCoreEngine.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Checker/PathSensitive/GRCoreEngine.h?rev=107209&r1=107208&r2=107209&view=diff
==============================================================================
--- cfe/trunk/include/clang/Checker/PathSensitive/GRCoreEngine.h (original)
+++ cfe/trunk/include/clang/Checker/PathSensitive/GRCoreEngine.h Tue Jun 29 16:58:54 2010
@@ -57,6 +57,10 @@
   ///   These are used to record for key nodes in the ExplodedGraph the
   ///   number of times different CFGBlocks have been visited along a path.
   GRBlockCounter::Factory BCounterFactory;
+  
+  /// A flag that indicates whether paths were halted because 
+  ///  ProcessBlockEntrace returned false. 
+  bool BlockAborted;
 
   void GenerateNode(const ProgramPoint& Loc, const GRState* State,
                     ExplodedNode* Pred);
@@ -108,14 +112,16 @@
   GRCoreEngine(ASTContext& ctx, GRSubEngine& subengine)
     : SubEngine(subengine), G(new ExplodedGraph(ctx)),
       WList(GRWorkList::MakeBFS()),
-      BCounterFactory(G->getAllocator()) {}
+      BCounterFactory(G->getAllocator()),
+      BlockAborted(false) {}
 
   /// Construct a GRCoreEngine object to analyze the provided CFG and to
   ///  use the provided worklist object to execute the worklist algorithm.
   ///  The GRCoreEngine object assumes ownership of 'wlist'.
   GRCoreEngine(ASTContext& ctx, GRWorkList* wlist, GRSubEngine& subengine)
     : SubEngine(subengine), G(new ExplodedGraph(ctx)), WList(wlist),
-      BCounterFactory(G->getAllocator()) {}
+      BCounterFactory(G->getAllocator()),
+      BlockAborted(false) {}
 
   ~GRCoreEngine() {
     delete WList;

Modified: cfe/trunk/lib/Checker/GRCoreEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/GRCoreEngine.cpp?rev=107209&r1=107208&r2=107209&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/GRCoreEngine.cpp (original)
+++ cfe/trunk/lib/Checker/GRCoreEngine.cpp Tue Jun 29 16:58:54 2010
@@ -221,7 +221,7 @@
     }
   }
 
-  SubEngine.ProcessEndWorklist(WList->hasWork());
+  SubEngine.ProcessEndWorklist(WList->hasWork() || BlockAborted);
   return WList->hasWork();
 }
 
@@ -258,7 +258,10 @@
   // FIXME: Should we allow ProcessBlockEntrance to also manipulate state?
 
   if (ProcessBlockEntrance(Blk, Pred, WList->getBlockCounter()))
-    GenerateNode(BlockEntrance(Blk, Pred->getLocationContext()), Pred->State, Pred);
+    GenerateNode(BlockEntrance(Blk, Pred->getLocationContext()),
+                 Pred->State, Pred);
+  else
+    BlockAborted = true;
 }
 
 void GRCoreEngine::HandleBlockEntrance(const BlockEntrance& L,





More information about the cfe-commits mailing list