[llvm] a7afa37 - [llvm-cov] Use std::optional in SourceCoverageViewText.cpp (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 26 18:47:33 PST 2022
Author: Kazu Hirata
Date: 2022-11-26T18:47:28-08:00
New Revision: a7afa37fb2010b191cce3da867740e34a9decda6
URL: https://github.com/llvm/llvm-project/commit/a7afa37fb2010b191cce3da867740e34a9decda6
DIFF: https://github.com/llvm/llvm-project/commit/a7afa37fb2010b191cce3da867740e34a9decda6.diff
LOG: [llvm-cov] Use std::optional in SourceCoverageViewText.cpp (NFC)
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
Added:
Modified:
llvm/tools/llvm-cov/SourceCoverageViewText.cpp
Removed:
################################################################################
diff --git a/llvm/tools/llvm-cov/SourceCoverageViewText.cpp b/llvm/tools/llvm-cov/SourceCoverageViewText.cpp
index 948414a4f995..5f3eca336a7e 100644
--- a/llvm/tools/llvm-cov/SourceCoverageViewText.cpp
+++ b/llvm/tools/llvm-cov/SourceCoverageViewText.cpp
@@ -16,6 +16,7 @@
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/Format.h"
+#include <optional>
using namespace llvm;
@@ -102,7 +103,7 @@ void SourceCoverageViewText::renderLine(raw_ostream &OS, LineRef L,
auto *WrappedSegment = LCS.getWrappedSegment();
CoverageSegmentArray Segments = LCS.getLineSegments();
- Optional<raw_ostream::Colors> Highlight;
+ std::optional<raw_ostream::Colors> Highlight;
SmallVector<std::pair<unsigned, unsigned>, 2> HighlightedRanges;
// The first segment overlaps from a previous line, so we treat it specially.
More information about the llvm-commits
mailing list