]> granicus.if.org Git - clang/commitdiff
[analyzer] Tweak the NumFunctionsAnalyzed stat so that it's more useful.
authorAnna Zaks <ganna@apple.com>
Mon, 17 Dec 2012 20:08:54 +0000 (20:08 +0000)
committerAnna Zaks <ganna@apple.com>
Mon, 17 Dec 2012 20:08:54 +0000 (20:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170362 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
test/Analysis/objc-method-coverage.m

index a531f6df3f4e7897cf41b361c3c4fd7735a97dad..6133e168c42f0679705bc49b001b172350d35028 100644 (file)
@@ -53,9 +53,10 @@ static ExplodedNode::Auditor* CreateUbiViz();
 
 STATISTIC(NumFunctionTopLevel, "The # of functions at top level.");
 STATISTIC(NumFunctionsAnalyzed,
-                     "The # of functions and blocks analyzed (as top level).");
+                      "The # of functions and blocks analyzed (as top level "
+                      "with inlining turned on).");
 STATISTIC(NumBlocksInAnalyzedFunctions,
-                     "The # of basic blocks in the analyzed functions.");
+                      "The # of basic blocks in the analyzed functions.");
 STATISTIC(PercentReachableBlocks, "The % of reachable basic blocks.");
 STATISTIC(MaxCFGSize, "The maximum number of basic blocks in a function.");
 
@@ -617,7 +618,8 @@ void AnalysisConsumer::HandleCode(Decl *D, AnalysisMode Mode,
         checkerMgr->runCheckersOnASTBody(*WI, *Mgr, BR);
       if ((Mode & AM_Path) && checkerMgr->hasPathSensitiveCheckers()) {
         RunPathSensitiveChecks(*WI, IMode, VisitedCallees);
-        NumFunctionsAnalyzed++;
+        if (IMode != ExprEngine::Inline_None)
+          NumFunctionsAnalyzed++;
       }
     }
 }
index 50a4888dfa9e1f1d83175ce78571680effb1addb..cb66bff19b44978f1256f3824a375c68dc2b158c 100644 (file)
@@ -1,6 +1,4 @@
 // RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-stats -fblocks %s 2>&1 | FileCheck %s
-// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-ipa=none -analyzer-stats -fblocks %s 2>&1 | FileCheck %s
-
 @interface I
 int f() {
   return 0;
@@ -14,4 +12,5 @@ int f() {
 @end
 
 // CHECK: ... Statistics Collected ...
-// CHECK: 2 AnalysisConsumer - The # of functions and blocks analyzed (as top level).
\ No newline at end of file
+// CHECK: 2 AnalysisConsumer - The # of functions and blocks analyzed (as top level with inlining turned on).
+// CHECK: 100 AnalysisConsumer - The % of reachable basic blocks.
\ No newline at end of file