summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cov/llvm-cov.cpp
diff options
context:
space:
mode:
authorYuchen Wu <yuchenericwu@hotmail.com>2013-12-10 01:02:07 +0000
committerYuchen Wu <yuchenericwu@hotmail.com>2013-12-10 01:02:07 +0000
commit8c6bb5f4d4bddf1a41471dbd115d37b21d982abe (patch)
tree5b355ac627ef59aa84b36fa40a2f1a23dc14e117 /llvm/tools/llvm-cov/llvm-cov.cpp
parent66747221e8749a0f228bd47f43fb43bdb749e81a (diff)
downloadbcm5719-llvm-8c6bb5f4d4bddf1a41471dbd115d37b21d982abe.tar.gz
bcm5719-llvm-8c6bb5f4d4bddf1a41471dbd115d37b21d982abe.zip
llvm-cov: Added -a option for block data.
Similar to gcov, llvm-cov will now print out the block count at the end of each block. Multiple blocks can end on the same line. One computational difference is by using -a, llvm-cov will no longer simply add the block counts together to form a line count. Instead, it will take the maximum of the block counts on that line. This has a similar effect to what gcov does, but generates more correct counts in certain scenarios. Also updated tests. llvm-svn: 196856
Diffstat (limited to 'llvm/tools/llvm-cov/llvm-cov.cpp')
-rw-r--r--llvm/tools/llvm-cov/llvm-cov.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/tools/llvm-cov/llvm-cov.cpp b/llvm/tools/llvm-cov/llvm-cov.cpp
index 7d3277aa8bd..235670b7ce8 100644
--- a/llvm/tools/llvm-cov/llvm-cov.cpp
+++ b/llvm/tools/llvm-cov/llvm-cov.cpp
@@ -30,6 +30,9 @@ InputGCNO("gcno", cl::desc("<input gcno file>"), cl::init(""));
static cl::opt<std::string>
InputGCDA("gcda", cl::desc("<input gcda file>"), cl::init(""));
+static cl::opt<bool>
+AllBlocks("a", cl::init(false), cl::desc("display all block info"));
+
//===----------------------------------------------------------------------===//
int main(int argc, char **argv) {
// Print a stack trace if we signal out.
@@ -67,12 +70,11 @@ int main(int argc, char **argv) {
}
}
-
if (DumpGCOV)
GF.dump();
FileInfo FI;
GF.collectLineCounts(FI);
- FI.print(InputGCNO, InputGCDA);
+ FI.print(InputGCNO, InputGCDA, GCOVOptions(AllBlocks));
return 0;
}
OpenPOWER on IntegriCloud