[llvm-cov] Suppress sub-line highlights in simple cases

llvm-cov tends to highlight too many regions because its policy is to
highlight all region entry segments. This can look confusing to users:
not all region entry segments are interesting and deserve highlighting.
Emitting these highlights only when the region count differs from the
line count is a more user-friendly policy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316109 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Vedant Kumar
2017-10-18 18:52:29 +00:00
parent d35bb38d3b
commit 4a5c81f50f
4 changed files with 7 additions and 15 deletions
@@ -563,6 +563,8 @@ void SourceCoverageViewHTML::renderLine(raw_ostream &OS, LineRef L,
const auto *CurSeg = Segments[I];
if (!CurSeg->IsRegionEntry)
continue;
if (CurSeg->Count == LCS.getExecutionCount())
continue;
Snippets[I + 1] =
tag("div", Snippets[I + 1] + tag("span", formatCount(CurSeg->Count),