From: Anna Zaks Date: Mon, 17 Dec 2012 20:08:54 +0000 (+0000) Subject: [analyzer] Tweak the NumFunctionsAnalyzed stat so that it's more useful. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=39cf781d62daaec09e443c6e66a01cd7543ffb41;p=clang [analyzer] Tweak the NumFunctionsAnalyzed stat so that it's more useful. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170362 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp index a531f6df3f..6133e168c4 100644 --- a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp +++ b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp @@ -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++; } } } diff --git a/test/Analysis/objc-method-coverage.m b/test/Analysis/objc-method-coverage.m index 50a4888dfa..cb66bff19b 100644 --- a/test/Analysis/objc-method-coverage.m +++ b/test/Analysis/objc-method-coverage.m @@ -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