summaryrefslogtreecommitdiffstats
path: root/clang
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
commit5720600798a53cee2eab8198db9ab8ff9a2e4e0a (patch)
treece2dcfa4d90d2f1c1de70998e20e802a41fff4d0 /clang
parente70eea023463928575ca700eaaf8b5f795171056 (diff)
downloadbcm5719-llvm-5720600798a53cee2eab8198db9ab8ff9a2e4e0a.tar.gz
bcm5719-llvm-5720600798a53cee2eab8198db9ab8ff9a2e4e0a.zip
[analyzer] Add a coverage calculation to FunctionSummaries.
llvm-svn: 154076
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h
index e1e15620fa3..33943d9f1cd 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h
+++ b/clang/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
OpenPOWER on IntegriCloud