diff options
author | Yuchen Wu <yuchenericwu@hotmail.com> | 2013-12-18 21:12:51 +0000 |
---|---|---|
committer | Yuchen Wu <yuchenericwu@hotmail.com> | 2013-12-18 21:12:51 +0000 |
commit | 8cb0f6e78e491e9bb8c3612a6e1062243beaad4f (patch) | |
tree | f02504492fb2608f38c4f5b05eff46fea0a62848 /include/llvm/Support | |
parent | 4fc184584c8271fcd6dea39676b39681bf356f83 (diff) | |
download | llvm-8cb0f6e78e491e9bb8c3612a6e1062243beaad4f.tar.gz llvm-8cb0f6e78e491e9bb8c3612a6e1062243beaad4f.tar.bz2 llvm-8cb0f6e78e491e9bb8c3612a6e1062243beaad4f.tar.xz |
llvm-cov: Print coverage summary to STDOUT.
File summaries will now be optionally outputted which will give line,
branching and call coverage info. Unfortunately, clang's current
instrumentation does not give enough information to deduce function
calls, something that gcc is able to do. Thus, no calls are always
outputted to be consistent with gcov output.
Also updated tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197606 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support')
-rw-r--r-- | include/llvm/Support/GCOV.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/llvm/Support/GCOV.h b/include/llvm/Support/GCOV.h index a0468bd815..eb536f50dc 100644 --- a/include/llvm/Support/GCOV.h +++ b/include/llvm/Support/GCOV.h @@ -350,6 +350,19 @@ class FileInfo { BlockLines Blocks; FunctionLines Functions; }; + + struct GCOVCoverage { + GCOVCoverage() : + LogicalLines(0), LinesExec(0), Branches(0), BranchesExec(0), + BranchesTaken(0) {} + + uint32_t LogicalLines; + uint32_t LinesExec; + + uint32_t Branches; + uint32_t BranchesExec; + uint32_t BranchesTaken; + }; public: FileInfo(const GCOVOptions &Options) : Options(Options), LineInfo(), RunCount(0), ProgramCount(0) {} @@ -370,9 +383,10 @@ private: void printBlockInfo(raw_fd_ostream &OS, const GCOVBlock &Block, uint32_t LineIndex, uint32_t &BlockNo) const; void printBranchInfo(raw_fd_ostream &OS, const GCOVBlock &Block, - uint32_t &EdgeNo) const; + GCOVCoverage &Coverage, uint32_t &EdgeNo) const; void printUncondBranchInfo(raw_fd_ostream &OS, uint32_t &EdgeNo, uint64_t Count) const; + void printFileCoverage(StringRef Filename, GCOVCoverage &Coverage) const; const GCOVOptions &Options; StringMap<LineData> LineInfo; |