[cfe-commits] r154076 - /cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h
Anna Zaks
ganna at apple.com
Wed Apr 4 19:10:17 PDT 2012
Author: zaks
Date: Wed Apr 4 21:10:17 2012
New Revision: 154076
URL: http://llvm.org/viewvc/llvm-project?rev=154076&view=rev
Log:
[analyzer] Add a coverage calculation to FunctionSummaries.
Modified:
cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h
Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h?rev=154076&r1=154075&r2=154076&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h (original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h Wed Apr 4 21:10:17 2012
@@ -87,8 +87,18 @@
return 0;
}
+ /// Get the percentage of the reachable blocks.
+ unsigned getPercentBlocksReachable(const Decl *D) {
+ MapTy::const_iterator I = Map.find(D);
+ if (I != Map.end())
+ return ((I->second->VisitedBasicBlocks.count() * 100) /
+ I->second->TotalBasicBlocks);
+ return 0;
+ }
+
unsigned getTotalNumBasicBlocks();
unsigned getTotalNumVisitedBasicBlocks();
+
};
}} // end clang ento namespaces
More information about the cfe-commits
mailing list