aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-cov/SourceCoverageViewText.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-cov/SourceCoverageViewText.cpp')
-rw-r--r--llvm/tools/llvm-cov/SourceCoverageViewText.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/tools/llvm-cov/SourceCoverageViewText.cpp b/llvm/tools/llvm-cov/SourceCoverageViewText.cpp
index cab60c2..8b93b59 100644
--- a/llvm/tools/llvm-cov/SourceCoverageViewText.cpp
+++ b/llvm/tools/llvm-cov/SourceCoverageViewText.cpp
@@ -179,7 +179,7 @@ void SourceCoverageViewText::renderLine(raw_ostream &OS, LineRef L,
unsigned Col = 1;
for (const auto *S : Segments) {
unsigned End = std::min(S->Col, static_cast<unsigned>(Line.size()) + 1);
- colored_ostream(OS, Highlight ? *Highlight : raw_ostream::SAVEDCOLOR,
+ colored_ostream(OS, Highlight.value_or(raw_ostream::SAVEDCOLOR),
getOptions().Colors && Highlight, /*Bold=*/false,
/*BG=*/true)
<< Line.substr(Col - 1, End - Col);
@@ -196,7 +196,7 @@ void SourceCoverageViewText::renderLine(raw_ostream &OS, LineRef L,
}
// Show the rest of the line.
- colored_ostream(OS, Highlight ? *Highlight : raw_ostream::SAVEDCOLOR,
+ colored_ostream(OS, Highlight.value_or(raw_ostream::SAVEDCOLOR),
getOptions().Colors && Highlight, /*Bold=*/false, /*BG=*/true)
<< Line.substr(Col - 1, Line.size() - Col + 1);
OS << '\n';