summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorYuchen Wu <yuchenericwu@hotmail.com>2013-12-13 01:15:07 +0000
committerYuchen Wu <yuchenericwu@hotmail.com>2013-12-13 01:15:07 +0000
commita2639798a8546537dc7cdd3bf21e4c179243e941 (patch)
treed966257316594e18fada31fca25eca8f8c27bdda /tools
parentf4597a0cd46ca119ca955237b847a990b1be9358 (diff)
downloadllvm-a2639798a8546537dc7cdd3bf21e4c179243e941.tar.gz
llvm-a2639798a8546537dc7cdd3bf21e4c179243e941.tar.bz2
llvm-a2639798a8546537dc7cdd3bf21e4c179243e941.tar.xz
llvm-cov: Added -b option for branch probabilities.
This option tells llvm-cov to print out branch probabilities when a basic block contains multiple branches. It also prints out some function summary info including the number of times the function enters, the percent of time it returns, and how many blocks were executed. Also updated tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197198 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/llvm-cov/llvm-cov.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/llvm-cov/llvm-cov.cpp b/tools/llvm-cov/llvm-cov.cpp
index 235670b7ce..fd4fa24411 100644
--- a/tools/llvm-cov/llvm-cov.cpp
+++ b/tools/llvm-cov/llvm-cov.cpp
@@ -33,6 +33,9 @@ InputGCDA("gcda", cl::desc("<input gcda file>"), cl::init(""));
static cl::opt<bool>
AllBlocks("a", cl::init(false), cl::desc("display all block info"));
+static cl::opt<bool>
+BranchProb("b", cl::init(false), cl::desc("display branch info"));
+
//===----------------------------------------------------------------------===//
int main(int argc, char **argv) {
// Print a stack trace if we signal out.
@@ -73,8 +76,9 @@ int main(int argc, char **argv) {
if (DumpGCOV)
GF.dump();
- FileInfo FI;
+ GCOVOptions Options(AllBlocks, BranchProb);
+ FileInfo FI(Options);
GF.collectLineCounts(FI);
- FI.print(InputGCNO, InputGCDA, GCOVOptions(AllBlocks));
+ FI.print(InputGCNO, InputGCDA);
return 0;
}