diff options
author | Vedant Kumar <vsk@apple.com> | 2017-11-09 02:33:43 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2017-11-09 02:33:43 +0000 |
commit | 43247f05421ba6e6f247592be6c2f39778796c6e (patch) | |
tree | 7a1043fdaf2a1e6c1bb7d6b9546a068d8dd6895d /llvm/tools/llvm-cov/SourceCoverageViewText.cpp | |
parent | f9a0d44eea28ada1adf75e5e63274055fccd65ab (diff) | |
download | bcm5719-llvm-43247f05421ba6e6f247592be6c2f39778796c6e.tar.gz bcm5719-llvm-43247f05421ba6e6f247592be6c2f39778796c6e.zip |
[Coverage] Use the wrapped segment when a line has entry segments
We've worked around bugs in the frontend by ignoring the count from
wrapped segments when a line has at least one region entry segment.
Those frontend bugs are now fixed, so it's time to regenerate the
checked-in covmapping files and remove the workaround.
llvm-svn: 317761
Diffstat (limited to 'llvm/tools/llvm-cov/SourceCoverageViewText.cpp')
-rw-r--r-- | llvm/tools/llvm-cov/SourceCoverageViewText.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/tools/llvm-cov/SourceCoverageViewText.cpp b/llvm/tools/llvm-cov/SourceCoverageViewText.cpp index 4b69b08e5a5..2480ee9f416 100644 --- a/llvm/tools/llvm-cov/SourceCoverageViewText.cpp +++ b/llvm/tools/llvm-cov/SourceCoverageViewText.cpp @@ -106,7 +106,8 @@ void SourceCoverageViewText::renderLine(raw_ostream &OS, LineRef L, SmallVector<std::pair<unsigned, unsigned>, 2> HighlightedRanges; // The first segment overlaps from a previous line, so we treat it specially. - if (WrappedSegment && WrappedSegment->HasCount && WrappedSegment->Count == 0) + if (WrappedSegment && !WrappedSegment->IsGapRegion && + WrappedSegment->HasCount && WrappedSegment->Count == 0) Highlight = raw_ostream::RED; // Output each segment of the line, possibly highlighted. @@ -120,11 +121,11 @@ void SourceCoverageViewText::renderLine(raw_ostream &OS, LineRef L, if (getOptions().Debug && Highlight) HighlightedRanges.push_back(std::make_pair(Col, End)); Col = End; - if (Col == ExpansionCol) - Highlight = raw_ostream::CYAN; - else if ((!S->IsGapRegion || Highlight == raw_ostream::RED) && - S->HasCount && S->Count == 0) + if ((!S->IsGapRegion || (Highlight && *Highlight == raw_ostream::RED)) && + S->HasCount && S->Count == 0) Highlight = raw_ostream::RED; + else if (Col == ExpansionCol) + Highlight = raw_ostream::CYAN; else Highlight = None; } |