[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
This commit is contained in:
Vedant Kumar 2016-09-15 06:44:48 +00:00
parent 0bcb8fb950
commit 2fcbfcf470
2 changed files with 5 additions and 1 deletions

View 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>

View 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));