summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/tools/llvm-cov/SourceCoverageView.cpp3
-rw-r--r--llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp2
2 files changed, 3 insertions, 2 deletions
diff --git a/llvm/tools/llvm-cov/SourceCoverageView.cpp b/llvm/tools/llvm-cov/SourceCoverageView.cpp
index 8cf17f4a0a9..8b3ffe7c63a 100644
--- a/llvm/tools/llvm-cov/SourceCoverageView.cpp
+++ b/llvm/tools/llvm-cov/SourceCoverageView.cpp
@@ -176,7 +176,8 @@ void SourceCoverageView::print(raw_ostream &OS, bool WholeFile,
if (ShowSourceName)
renderSourceName(OS, WholeFile);
- renderTableHeader(OS, getFirstUncoveredLineNo(), ViewDepth);
+ renderTableHeader(OS, (ViewDepth > 0) ? 0 : getFirstUncoveredLineNo(),
+ ViewDepth);
// We need the expansions and instantiations sorted so we can go through them
// while we iterate lines.
diff --git a/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp b/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp
index 31d6fd3048b..73da231b2aa 100644
--- a/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp
+++ b/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp
@@ -609,7 +609,7 @@ void SourceCoverageViewHTML::renderTableHeader(raw_ostream &OS,
unsigned FirstUncoveredLineNo,
unsigned ViewDepth) {
std::string SourceLabel;
- if (FirstUncoveredLineNo == 0 || ViewDepth > 0) {
+ if (FirstUncoveredLineNo == 0) {
SourceLabel = tag("td", tag("pre", "Source"));
} else {
std::string LinkTarget = "#L" + utostr(uint64_t(FirstUncoveredLineNo));
OpenPOWER on IntegriCloud