[analyzer] Tweak the NumFunctionsAnalyzed stat so that it's more useful.

llvm-svn: 170362
This commit is contained in:
Anna Zaks 2012-12-17 20:08:54 +00:00
parent d53182b0df
commit ad3704c96a
2 changed files with 7 additions and 6 deletions

View 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++;
}
}
}

View 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).
// CHECK: 2 AnalysisConsumer - The # of functions and blocks analyzed (as top level with inlining turned on).
// CHECK: 100 AnalysisConsumer - The % of reachable basic blocks.