aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/Bytecode/Reader/BytecodeReader.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2023-01-14 01:25:58 -0800
committerKazu Hirata <kazu@google.com>2023-01-14 01:25:58 -0800
commit0a81ace0047a2de93e71c82cdf0977fc989660df (patch)
tree79f7603ad4f5fa96332507dcea07fb3be4a966a5 /mlir/lib/Bytecode/Reader/BytecodeReader.cpp
parentbb83dc10f5e7aece86a0ad2158cfd28d1611f336 (diff)
downloadllvm-0a81ace0047a2de93e71c82cdf0977fc989660df.zip
llvm-0a81ace0047a2de93e71c82cdf0977fc989660df.tar.gz
llvm-0a81ace0047a2de93e71c82cdf0977fc989660df.tar.bz2
[mlir] Use std::optional instead of llvm::Optional (NFC)
This patch replaces (llvm::|)Optional< with std::optional<. I'll post a separate patch to remove #include "llvm/ADT/Optional.h". 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
Diffstat (limited to 'mlir/lib/Bytecode/Reader/BytecodeReader.cpp')
-rw-r--r--mlir/lib/Bytecode/Reader/BytecodeReader.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/mlir/lib/Bytecode/Reader/BytecodeReader.cpp b/mlir/lib/Bytecode/Reader/BytecodeReader.cpp
index 5860fd4..8dded64 100644
--- a/mlir/lib/Bytecode/Reader/BytecodeReader.cpp
+++ b/mlir/lib/Bytecode/Reader/BytecodeReader.cpp
@@ -1121,8 +1121,8 @@ private:
// Resource Section
LogicalResult
- parseResourceSection(Optional<ArrayRef<uint8_t>> resourceData,
- Optional<ArrayRef<uint8_t>> resourceOffsetData);
+ parseResourceSection(std::optional<ArrayRef<uint8_t>> resourceData,
+ std::optional<ArrayRef<uint8_t>> resourceOffsetData);
//===--------------------------------------------------------------------===//
// IR Section
@@ -1269,7 +1269,8 @@ LogicalResult BytecodeReader::read(llvm::MemoryBufferRef buffer, Block *block) {
});
// Parse the raw data for each of the top-level sections of the bytecode.
- Optional<ArrayRef<uint8_t>> sectionDatas[bytecode::Section::kNumSections];
+ std::optional<ArrayRef<uint8_t>>
+ sectionDatas[bytecode::Section::kNumSections];
while (!reader.empty()) {
// Read the next section from the bytecode.
bytecode::Section::ID sectionID;
@@ -1389,8 +1390,8 @@ FailureOr<OperationName> BytecodeReader::parseOpName(EncodingReader &reader) {
// Resource Section
LogicalResult BytecodeReader::parseResourceSection(
- Optional<ArrayRef<uint8_t>> resourceData,
- Optional<ArrayRef<uint8_t>> resourceOffsetData) {
+ std::optional<ArrayRef<uint8_t>> resourceData,
+ std::optional<ArrayRef<uint8_t>> resourceOffsetData) {
// Ensure both sections are either present or not.
if (resourceData.has_value() != resourceOffsetData.has_value()) {
if (resourceOffsetData)