summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cov/SourceCoverageViewText.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/SourceCoverageViewText.cpp
parent08a0a3100389dc850729673e6591a539693c1fe0 (diff)
downloadbcm5719-llvm-9cbd33fec9d7a15cc2ef9f9fd82491baa41eb552.tar.gz
bcm5719-llvm-9cbd33fec9d7a15cc2ef9f9fd82491baa41eb552.zip
[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/SourceCoverageViewText.cpp')
-rw-r--r--llvm/tools/llvm-cov/SourceCoverageViewText.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/tools/llvm-cov/SourceCoverageViewText.cpp b/llvm/tools/llvm-cov/SourceCoverageViewText.cpp
index 83d228e3670..2ed16dfbc69 100644
--- a/llvm/tools/llvm-cov/SourceCoverageViewText.cpp
+++ b/llvm/tools/llvm-cov/SourceCoverageViewText.cpp
@@ -186,6 +186,8 @@ void SourceCoverageViewText::renderRegionMarkers(raw_ostream &OS,
for (const auto *S : Segments) {
if (!S->IsRegionEntry)
continue;
+ if (S->Count == Line.getExecutionCount())
+ continue;
// Skip to the new region.
if (S->Col > PrevColumn)
OS.indent(S->Col - PrevColumn);
OpenPOWER on IntegriCloud