From 2fcbfcf47019655dcaf6896c553ac0d3ac77b60a Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Thu, 15 Sep 2016 06:44:48 +0000 Subject: [PATCH] [llvm-cov] Don't create 'jump to ...' links in nested views Doing so is pointless, since the whole view is usually visible in a small amount of space. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281588 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/tools/llvm-cov/showTemplateInstantiations.cpp | 4 ++++ tools/llvm-cov/SourceCoverageViewHTML.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/test/tools/llvm-cov/showTemplateInstantiations.cpp b/test/tools/llvm-cov/showTemplateInstantiations.cpp index 40ac9d3ad88..38ad0cfa8c9 100644 --- a/test/tools/llvm-cov/showTemplateInstantiations.cpp +++ b/test/tools/llvm-cov/showTemplateInstantiations.cpp @@ -83,3 +83,7 @@ int main() { // ALL: [[@LINE]]| 1|int main() { // HTML-ALL:
[[@LINE-45]]
// after
 // HTML-FILTER-NOT: 
[[@LINE-46]]
// after
+
+// RUN: FileCheck -check-prefix=HTML-JUMP -input-file=%t.html.dir/coverage/tmp/showTemplateInstantiations.cpp.html %s
+// HTML-JUMP: 
Source (jump to first uncovered line)
+// HTML-JUMP-NOT:
Source (jump to first uncovered line)
diff --git a/tools/llvm-cov/SourceCoverageViewHTML.cpp b/tools/llvm-cov/SourceCoverageViewHTML.cpp index 2fef1b4175d..0f176551550 100644 --- a/tools/llvm-cov/SourceCoverageViewHTML.cpp +++ b/tools/llvm-cov/SourceCoverageViewHTML.cpp @@ -601,7 +601,7 @@ void SourceCoverageViewHTML::renderTableHeader(raw_ostream &OS, unsigned FirstUncoveredLineNo, unsigned ViewDepth) { std::string SourceLabel; - if (FirstUncoveredLineNo == 0) { + if (FirstUncoveredLineNo == 0 || ViewDepth > 0) { SourceLabel = tag("td", tag("pre", "Source")); } else { std::string LinkTarget = "#L" + utostr(uint64_t(FirstUncoveredLineNo)); -- 2.50.1