[llvm] [llvm-cov][CoverageView] minor fix/improvement to HTML and text coverage output (PR #80952)

Wentao Zhang via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 7 08:31:11 PST 2024


================
@@ -990,15 +993,13 @@ void SourceCoverageViewHTML::renderMCDCView(raw_ostream &OS, MCDCView &MRV,
     std::string ColNoStr = Twine(DecisionRegion.ColumnStart).str();
     std::string TargetName = "L" + LineNoStr;
     OS << tag("span",
-              a("#" + TargetName, tag("span", LineNoStr + ":" + ColNoStr),
-                TargetName),
+              a("#" + TargetName, tag("span", LineNoStr + ":" + ColNoStr)),
----------------
whentojump wrote:

Each line number is rendered like this

```html
<a name="L19" href="#L19">
  <pre>19</pre>
</a>
```

so that a URL ending with a `#L19` can directly jump to this line.

If we create multiple elements with the same `name="L19"`, the jump destination might not be the actual code location (line number), but the link within an MC/DC view or branch view.

https://github.com/llvm/llvm-project/pull/80952


More information about the llvm-commits mailing list