aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-04-05 02:10:17 +0000
committerAnna Zaks <ganna@apple.com>2012-04-05 02:10:17 +0000
commitcd863466b97cee866370bc6ff75370628ab01d37 (patch)
tree367f3d24c8e96b1b3e66f02a76b4e4f321da6486
parent4f4705faae9fc10e21be95eb39317f714cf8307f (diff)
[analyzer] Add a coverage calculation to FunctionSummaries.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154076 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h b/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h
index e1e15620fa..33943d9f1c 100644
--- a/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h
+++ b/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h
@@ -87,8 +87,18 @@ public:
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