[llvm-cov] Turn line numbers in html reports into clickable links
llvm-svn: 285853
This commit is contained in:
@@ -64,8 +64,9 @@ std::string tag(const std::string &Name, const std::string &Str,
|
||||
|
||||
// Create an anchor to \p Link with the label \p Str.
|
||||
std::string a(const std::string &Link, const std::string &Str,
|
||||
const std::string &TargetType = "href") {
|
||||
return "<a " + TargetType + "='" + Link + "'>" + Str + "</a>";
|
||||
const std::string &TargetName = "") {
|
||||
std::string Name = TargetName.empty() ? "" : ("name='" + TargetName + "' ");
|
||||
return "<a " + Name + "href='" + Link + "'>" + Str + "</a>";
|
||||
}
|
||||
|
||||
const char *BeginHeader =
|
||||
@@ -560,7 +561,8 @@ void SourceCoverageViewHTML::renderLineCoverageColumn(
|
||||
void SourceCoverageViewHTML::renderLineNumberColumn(raw_ostream &OS,
|
||||
unsigned LineNo) {
|
||||
std::string LineNoStr = utostr(uint64_t(LineNo));
|
||||
OS << tag("td", a("L" + LineNoStr, tag("pre", LineNoStr), "name"),
|
||||
std::string TargetName = "L" + LineNoStr;
|
||||
OS << tag("td", a("#" + TargetName, tag("pre", LineNoStr), TargetName),
|
||||
"line-number");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user