aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2017-10-18 18:52:29 +0000
committerVedant Kumar <vsk@apple.com>2017-10-18 18:52:29 +0000
commit9cbd33fec9d7a15cc2ef9f9fd82491baa41eb552 (patch)
tree2cc71eaac68ef713cc50fb0d968d8bbb91fdfe8b /llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp
parent08a0a3100389dc850729673e6591a539693c1fe0 (diff)
downloadllvm-9cbd33fec9d7a15cc2ef9f9fd82491baa41eb552.zip
llvm-9cbd33fec9d7a15cc2ef9f9fd82491baa41eb552.tar.gz
llvm-9cbd33fec9d7a15cc2ef9f9fd82491baa41eb552.tar.bz2
[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
Diffstat (limited to 'llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp')
-rw-r--r--llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp2
1 files changed, 2 insertions, 0 deletions
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),