diff options
author | Eli Friedman <efriedma@codeaurora.org> | 2017-08-09 20:43:31 +0000 |
---|---|---|
committer | Eli Friedman <efriedma@codeaurora.org> | 2017-08-09 20:43:31 +0000 |
commit | c0c182cce1565213a4b0b0a7284538fbcf8b5955 (patch) | |
tree | 758f6d6294057b08fe1a87f9b73402b4df9aa4be /llvm/tools/llvm-cov/CoverageReport.cpp | |
parent | 14a22a442d8aa6bee8c828872b82b7dd722dc7b8 (diff) | |
download | bcm5719-llvm-c0c182cce1565213a4b0b0a7284538fbcf8b5955.tar.gz bcm5719-llvm-c0c182cce1565213a4b0b0a7284538fbcf8b5955.zip |
[llvm-cov] Rearrange entries in report index.
Files which don't contain any functions are likely useless; don't
include them in the main table. Put the links at the bottom of the
page, in case someone wants to figure out coverage for code inside
a macro.
Not sure if this is the best solution, but it seems like an
improvement.
Differential Revision: https://reviews.llvm.org/D36298
llvm-svn: 310518
Diffstat (limited to 'llvm/tools/llvm-cov/CoverageReport.cpp')
-rw-r--r-- | llvm/tools/llvm-cov/CoverageReport.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/llvm/tools/llvm-cov/CoverageReport.cpp b/llvm/tools/llvm-cov/CoverageReport.cpp index 7c273a2430c..3c9bf3975b3 100644 --- a/llvm/tools/llvm-cov/CoverageReport.cpp +++ b/llvm/tools/llvm-cov/CoverageReport.cpp @@ -371,8 +371,22 @@ void CoverageReport::renderFileReports(raw_ostream &OS, renderDivider(FileReportColumns, OS); OS << "\n"; - for (const FileCoverageSummary &FCS : FileReports) - render(FCS, OS); + bool EmptyFiles = false; + for (const FileCoverageSummary &FCS : FileReports) { + if (FCS.FunctionCoverage.NumFunctions) + render(FCS, OS); + else + EmptyFiles = true; + } + + if (EmptyFiles) { + OS << "\n" + << "Files which contain no functions:\n"; + + for (const FileCoverageSummary &FCS : FileReports) + if (!FCS.FunctionCoverage.NumFunctions) + render(FCS, OS); + } renderDivider(FileReportColumns, OS); OS << "\n"; |