llvm-cov: Added -f option for function summaries.

Similar to the file summaries, the function summaries output line,
branching and call statistics. The file summaries have been moved
outside the initial loop so that all of the function summaries can be
outputted before file summaries.

Also updated test cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197633 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Yuchen Wu
2013-12-19 00:29:25 +00:00
parent deb8e33163
commit d218959ec5
6 changed files with 211 additions and 23 deletions

View File

@@ -40,6 +40,9 @@ static cl::opt<bool>
BranchCount("c", cl::init(false), cl::desc("display branch counts instead of \
probabilities (requires -b)"));
static cl::opt<bool>
FuncCoverage("f", cl::init(false), cl::desc("output function coverage"));
static cl::opt<bool>
UncondBranch("u", cl::init(false), cl::desc("display unconditional branch info \
(requires -b)"));
@@ -84,7 +87,8 @@ int main(int argc, char **argv) {
if (DumpGCOV)
GF.dump();
GCOVOptions Options(AllBlocks, BranchInfo, BranchCount, UncondBranch);
GCOVOptions Options(AllBlocks, BranchInfo, BranchCount, FuncCoverage,
UncondBranch);
FileInfo FI(Options);
GF.collectLineCounts(FI);
FI.print(InputGCNO, InputGCDA);