[cfe-commits] r152960 - /cfe/trunk/lib/StaticAnalyzer/Core/CoreEngine.cpp

Anna Zaks ganna at apple.com
Fri Mar 16 16:24:14 PDT 2012


Author: zaks
Date: Fri Mar 16 18:24:13 2012
New Revision: 152960

URL: http://llvm.org/viewvc/llvm-project?rev=152960&view=rev
Log:
[analyzer] Add a statistic for the number of times we reach the max
number of steps in the work list.

Modified:
    cfe/trunk/lib/StaticAnalyzer/Core/CoreEngine.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Core/CoreEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/CoreEngine.cpp?rev=152960&r1=152959&r2=152960&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/CoreEngine.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/CoreEngine.cpp Fri Mar 16 18:24:13 2012
@@ -12,6 +12,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "CoreEngine"
+
 #include "clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h"
 #include "clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h"
@@ -20,9 +22,14 @@
 #include "clang/AST/StmtCXX.h"
 #include "llvm/Support/Casting.h"
 #include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/Statistic.h"
+
 using namespace clang;
 using namespace ento;
 
+STATISTIC(NumReachedMaxSteps,
+            "The # of times we reached the max number of steps.");
+
 //===----------------------------------------------------------------------===//
 // Worklist classes for exploration of reachable states.
 //===----------------------------------------------------------------------===//
@@ -187,8 +194,10 @@
 
   while (WList->hasWork()) {
     if (!UnlimitedSteps) {
-      if (Steps == 0)
+      if (Steps == 0) {
+        NumReachedMaxSteps++;
         break;
+      }
       --Steps;
     }
 





More information about the cfe-commits mailing list