From 9cbd33fec9d7a15cc2ef9f9fd82491baa41eb552 Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Wed, 18 Oct 2017 18:52:29 +0000 Subject: [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. llvm-svn: 316109 --- llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp | 2 ++ 1 file changed, 2 insertions(+) (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 626016f..4900ad4 100644 --- a/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp +++ b/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp @@ -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), -- cgit v1.1