summaryrefslogtreecommitdiff
path: root/tools/llvm-cov/SourceCoverageViewHTML.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2016-09-10 19:37:26 +0000
committerVedant Kumar <vsk@apple.com>2016-09-10 19:37:26 +0000
commita8edd76b0ed2ece34065fe089e5dfc4afa43b3e4 (patch)
tree8d5384bc3de507e97cec8a53e1aa205d5a5adfa4 /tools/llvm-cov/SourceCoverageViewHTML.cpp
parentce19c1cc9518e0e873312ef3be0dc6bb0a2c33ec (diff)
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281146 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-cov/SourceCoverageViewHTML.cpp')
-rw-r--r--tools/llvm-cov/SourceCoverageViewHTML.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/tools/llvm-cov/SourceCoverageViewHTML.cpp b/tools/llvm-cov/SourceCoverageViewHTML.cpp
index 8bb51590fde..cfa3078a8b3 100644
--- a/tools/llvm-cov/SourceCoverageViewHTML.cpp
+++ b/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);
}