From b1c174aa1c2a4a903b728625f646d075a861ece4 Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Sat, 10 Sep 2016 19:37:26 +0000 Subject: [llvm-cov] Move the 'jump to first unexecuted line' link Having it in the same row as the source name is jarring. Move it next to the "Source" column label. llvm-svn: 281146 --- llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp | 29 +++++++++++++------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp') diff --git a/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp b/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp index 8bb51590fde..cfa3078a8b3 100644 --- a/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp +++ b/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp @@ -395,21 +395,11 @@ void SourceCoverageViewHTML::renderViewFooter(raw_ostream &OS) { OS << EndTable << EndCenteredDiv; } -void SourceCoverageViewHTML::renderSourceName(raw_ostream &OS, bool WholeFile, - unsigned FirstUncoveredLineNo) { +void SourceCoverageViewHTML::renderSourceName(raw_ostream &OS, bool WholeFile) { OS << BeginSourceNameDiv; std::string ViewInfo = escape( WholeFile ? getVerboseSourceName() : getSourceName(), getOptions()); OS << tag("pre", ViewInfo); - if (WholeFile) { - // Render the "Go to first unexecuted line" link for the view. - if (FirstUncoveredLineNo != 0) { // The file is not fully covered - std::string LinkText = - escape("Go to first unexecuted line", getOptions()); - std::string LinkTarget = "#L" + utostr(uint64_t(FirstUncoveredLineNo)); - OS << tag("pre", a(LinkTarget, LinkText)); - } - } OS << EndSourceNameDiv; } @@ -608,10 +598,21 @@ void SourceCoverageViewHTML::renderCellInTitle(raw_ostream &OS, } void SourceCoverageViewHTML::renderTableHeader(raw_ostream &OS, + unsigned FirstUncoveredLineNo, unsigned ViewDepth) { + std::string SourceLabel; + if (FirstUncoveredLineNo == 0) { + SourceLabel = tag("td", tag("pre", "Source")); + } else { + std::string LinkTarget = "#L" + utostr(uint64_t(FirstUncoveredLineNo)); + SourceLabel = + tag("td", tag("pre", "Source (" + + a(LinkTarget, "jump to first uncovered line") + + ")")); + } + renderLinePrefix(OS, ViewDepth); - OS << tag("td", tag("span", tag("pre", escape("Line No.", getOptions())))) - << tag("td", tag("span", tag("pre", escape("Count", getOptions())))) - << tag("td", tag("span", tag("pre", escape("Source", getOptions())))); + OS << tag("td", tag("pre", "Line No.")) << tag("td", tag("pre", "Count")) + << SourceLabel; renderLineSuffix(OS, ViewDepth); } -- cgit v1.2.3