From ea1e97b94ccaa25cc71cb0900c3dfd3d00e18b43 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. llvm-svn: 281588 --- llvm/test/tools/llvm-cov/showTemplateInstantiations.cpp | 4 ++++ llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/llvm/test/tools/llvm-cov/showTemplateInstantiations.cpp b/llvm/test/tools/llvm-cov/showTemplateInstantiations.cpp index 40ac9d3..38ad0cf 100644 --- a/llvm/test/tools/llvm-cov/showTemplateInstantiations.cpp +++ b/llvm/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/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp b/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp index 2fef1b4..0f17655 100644 --- a/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp +++ b/llvm/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.7.4