]> granicus.if.org Git - llvm/commitdiff
[llvm-cov] Don't create 'jump to ...' links in nested views
authorVedant Kumar <vsk@apple.com>
Thu, 15 Sep 2016 06:44:48 +0000 (06:44 +0000)
committerVedant Kumar <vsk@apple.com>
Thu, 15 Sep 2016 06:44:48 +0000 (06:44 +0000)
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
tools/llvm-cov/SourceCoverageViewHTML.cpp

index 40ac9d3ad88dab18f2f8c09aa523d5ff3dc5777a..38ad0cfa8c99dcca726d5f88a83d766fada518de 100644 (file)
@@ -83,3 +83,7 @@ int main() {         // ALL:         [[@LINE]]| 1|int main() {
 
 // HTML-ALL: <td class='line-number'><a name='L[[@LINE-45]]'><pre>[[@LINE-45]]</pre></a></td><td class='uncovered-line'></td><td class='code'><pre>// after
 // HTML-FILTER-NOT: <td class='line-number'><a name='L[[@LINE-46]]'><pre>[[@LINE-46]]</pre></a></td><td class='uncovered-line'></td><td class='code'><pre>// after
+
+// RUN: FileCheck -check-prefix=HTML-JUMP -input-file=%t.html.dir/coverage/tmp/showTemplateInstantiations.cpp.html %s
+// HTML-JUMP: <pre>Source (<a href='#L{{[0-9]+}}'>jump to first uncovered line</a>)</pre>
+// HTML-JUMP-NOT: <pre>Source (<a href='#L{{[0-9]+}}'>jump to first uncovered line</a>)</pre>
index 2fef1b4175d1f3be4c5676949fd2349e03671e1d..0f176551550e0190b474383ad20981edb9d1129c 100644 (file)
@@ -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));