From a2639798a8546537dc7cdd3bf21e4c179243e941 Mon Sep 17 00:00:00 2001 From: Yuchen Wu Date: Fri, 13 Dec 2013 01:15:07 +0000 Subject: 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 --- tools/llvm-cov/llvm-cov.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tools/llvm-cov') 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(""), cl::init("")); static cl::opt AllBlocks("a", cl::init(false), cl::desc("display all block info")); +static cl::opt +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; } -- cgit v1.2.3