]> granicus.if.org Git - clang/commitdiff
Change -analyzer-max-nodes to allow 0 as a parameter. This allows the analyzer to...
authorTom Care <tom.care@uqconnect.edu.au>
Wed, 29 Sep 2010 23:48:13 +0000 (23:48 +0000)
committerTom Care <tom.care@uqconnect.edu.au>
Wed, 29 Sep 2010 23:48:13 +0000 (23:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115108 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/CC1Options.td
lib/Checker/GRCoreEngine.cpp

index 512c2ca23bf999b514e379f8eafbfb1f2606e05f..c416c1a4bfe59c15a9f3aeb8c9fb79fb064c6240 100644 (file)
@@ -108,7 +108,7 @@ def analyzer_viz_egraph_ubigraph : Flag<"-analyzer-viz-egraph-ubigraph">,
 def analyzer_inline_call : Flag<"-analyzer-inline-call">,
   HelpText<"Experimental transfer function inlining callees when its definition is available.">;
 def analyzer_max_nodes : Separate<"-analyzer-max-nodes">,
-  HelpText<"The maximum number of nodes the analyzer can generate">;
+  HelpText<"The maximum number of nodes the analyzer can generate (150000 default, 0 = no limit)">;
 def analyzer_max_loop : Separate<"-analyzer-max-loop">,
   HelpText<"The maximum number of times the analyzer will go through a loop">;
 
index 6b7a2cb81216f0c225fa156768937cd579feec75..8b30a86ee2da95067374160544355089f07759e0 100644 (file)
@@ -159,8 +159,16 @@ bool GRCoreEngine::ExecuteWorkList(const LocationContext *L, unsigned Steps,
       GenerateNode(StartLoc, InitState, 0);
   }
 
-  while (Steps && WList->hasWork()) {
-    --Steps;
+  // Check if we have a steps limit
+  bool UnlimitedSteps = Steps == 0;
+
+  while (WList->hasWork()) {
+    if (!UnlimitedSteps) {
+      if (Steps == 0)
+        break;
+      --Steps;
+    }
+
     const GRWorkListUnit& WU = WList->Dequeue();
 
     // Set the current block counter.