1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

Revert "[llvm-cov] Minor aesthetic improvements for html reports"

This reverts commit r276906. It breaks tests.

llvm-svn: 276908
This commit is contained in:
Vedant Kumar 2016-07-27 19:59:44 +00:00
parent e18e67ba7d
commit 9989a77c2e

View File

@ -337,9 +337,9 @@ void SourceCoverageViewHTML::renderLine(
for (unsigned I = 0, E = Snippets.size(); I < E; ++I) for (unsigned I = 0, E = Snippets.size(); I < E; ++I)
Snippets[I] = escape(Snippets[I]); Snippets[I] = escape(Snippets[I]);
// 3. Use \p WrappedSegment to set the highlight for snippet 0. Use segment // 3. Use \p WrappedSegment to set the highlight for snippets 0 and 1. Use
// 1 to set the highlight for snippet 2, segment 2 to set the highlight for // segment 1 to set the highlight for snippet 2, segment 2 to set the
// snippet 3, and so on. // highlight for snippet 3, and so on.
Optional<std::string> Color; Optional<std::string> Color;
auto Highlight = [&](const std::string &Snippet) { auto Highlight = [&](const std::string &Snippet) {
@ -347,16 +347,17 @@ void SourceCoverageViewHTML::renderLine(
}; };
auto CheckIfUncovered = [](const coverage::CoverageSegment *S) { auto CheckIfUncovered = [](const coverage::CoverageSegment *S) {
return !S || (S->HasCount && S->Count == 0); return S && S->HasCount && S->Count == 0;
}; };
if (CheckIfUncovered(WrappedSegment) || if (CheckIfUncovered(WrappedSegment) ||
CheckIfUncovered(Segments.empty() ? nullptr : Segments.front())) { CheckIfUncovered(Segments.empty() ? nullptr : Segments.front())) {
Color = "red"; Color = "red";
Snippets[0] = Highlight(Snippets[0]); Snippets[0] = Highlight(Snippets[0]);
Snippets[1] = Highlight(Snippets[1]);
} }
for (unsigned I = 0, E = Segments.size(); I < E; ++I) { for (unsigned I = 1, E = Segments.size(); I < E; ++I) {
const auto *CurSeg = Segments[I]; const auto *CurSeg = Segments[I];
if (CurSeg->Col == ExpansionCol) if (CurSeg->Col == ExpansionCol)
Color = "cyan"; Color = "cyan";
@ -369,9 +370,6 @@ void SourceCoverageViewHTML::renderLine(
Snippets[I + 1] = Highlight(Snippets[I + 1]); Snippets[I + 1] = Highlight(Snippets[I + 1]);
} }
if (Color.hasValue() && Segments.empty())
Snippets.back() = Highlight(Snippets.back());
// 4. Snippets[1:N+1] correspond to \p Segments[0:N]: use these to generate // 4. Snippets[1:N+1] correspond to \p Segments[0:N]: use these to generate
// sub-line region count tooltips if needed. // sub-line region count tooltips if needed.
@ -392,7 +390,7 @@ void SourceCoverageViewHTML::renderLine(
Snippets[I + 1] = Snippets[I + 1] =
tag("div", Snippets[I + 1] + tag("span", formatCount(CurSeg->Count), tag("div", Snippets[I + 1] + tag("span", formatCount(CurSeg->Count),
"tooltip-content"), "tooltip-content"),
"tooltip"); "tooltip");
} }
} }