summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitb1c174aa1c2a4a903b728625f646d075a861ece4 (patch)
tree10bbc3faf11adc1ffc64f73ae5584daa546688fb /llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp
parent7b9e9bb49153c714a363acf4958373d8254d5a76 (diff)
downloadbcm5719-llvm-b1c174aa1c2a4a903b728625f646d075a861ece4.tar.gz
bcm5719-llvm-b1c174aa1c2a4a903b728625f646d075a861ece4.zip
[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
Diffstat (limited to 'llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp')
-rw-r--r--llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp29
1 files changed, 15 insertions, 14 deletions
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);
}
OpenPOWER on IntegriCloud