Skip to content

Commit 22fb258

Browse files
committed
[llvm-cov][CoverageViewHTML] remove name="Ln" attribute in the link within MC/DC views
Or it would conflict with the link at actual lines and jumping via URLs containing #Ln would fail
1 parent 40d5431 commit 22fb258

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

llvm/test/tools/llvm-cov/mcdc-general-none.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
// RUN: rm -rf %t.html.dir
5454
// RUN: llvm-cov show --show-mcdc-summary --show-mcdc %S/Inputs/mcdc-general.o -instr-profile %t.profdata -path-equivalence=.,%S/Inputs -format html -o %t.html.dir
5555
// RUN: FileCheck -check-prefix=HTML -input-file=%t.html.dir/coverage/mcdc-general.cpp.html %s
56-
// HTML-COUNT-4: MC/DC Decision Region (<span class='line-number'><a name='L{{[0-9]+}}' href='#L{{[0-9]+}}'><span>
56+
// HTML-COUNT-4: MC/DC Decision Region (<span class='line-number'><a href='#L{{[0-9]+}}'><span>
5757

5858
// RUN: FileCheck -check-prefix HTML-INDEX -input-file %t.html.dir/index.html %s
5959
// HTML-INDEX-LABEL: <table>

llvm/test/tools/llvm-cov/mcdc-general.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
// RUN: rm -rf %t.html.dir
120120
// RUN: llvm-cov show --show-mcdc-summary --show-mcdc %S/Inputs/mcdc-general.o -instr-profile %t.profdata -path-equivalence=.,%S/Inputs -format html -o %t.html.dir
121121
// RUN: FileCheck -check-prefix=HTML -input-file=%t.html.dir/coverage/mcdc-general.cpp.html %s
122-
// HTML-COUNT-4: MC/DC Decision Region (<span class='line-number'><a name='L{{[0-9]+}}' href='#L{{[0-9]+}}'><span>
122+
// HTML-COUNT-4: MC/DC Decision Region (<span class='line-number'><a href='#L{{[0-9]+}}'><span>
123123

124124
// RUN: FileCheck -check-prefix HTML-INDEX -input-file %t.html.dir/index.html %s
125125
// HTML-INDEX-LABEL: <table>

llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -993,15 +993,13 @@ void SourceCoverageViewHTML::renderMCDCView(raw_ostream &OS, MCDCView &MRV,
993993
std::string ColNoStr = Twine(DecisionRegion.ColumnStart).str();
994994
std::string TargetName = "L" + LineNoStr;
995995
OS << tag("span",
996-
a("#" + TargetName, tag("span", LineNoStr + ":" + ColNoStr),
997-
TargetName),
996+
a("#" + TargetName, tag("span", LineNoStr + ":" + ColNoStr)),
998997
"line-number") +
999998
") to (";
1000999
LineNoStr = utostr(uint64_t(DecisionRegion.LineEnd));
10011000
ColNoStr = utostr(uint64_t(DecisionRegion.ColumnEnd));
10021001
OS << tag("span",
1003-
a("#" + TargetName, tag("span", LineNoStr + ":" + ColNoStr),
1004-
TargetName),
1002+
a("#" + TargetName, tag("span", LineNoStr + ":" + ColNoStr)),
10051003
"line-number") +
10061004
")\n\n";
10071005

0 commit comments

Comments
 (0)