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
This commit is contained in:
Yuchen Wu
2013-12-13 01:15:07 +00:00
parent f4597a0cd4
commit a2639798a8
6 changed files with 355 additions and 37 deletions

View File

@@ -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;
}