From 0a81ace0047a2de93e71c82cdf0977fc989660df Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 14 Jan 2023 01:25:58 -0800 Subject: [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 --- mlir/lib/Bytecode/Reader/BytecodeReader.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'mlir/lib/Bytecode/Reader/BytecodeReader.cpp') 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> resourceData, - Optional> resourceOffsetData); + parseResourceSection(std::optional> resourceData, + std::optional> 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> sectionDatas[bytecode::Section::kNumSections]; + std::optional> + sectionDatas[bytecode::Section::kNumSections]; while (!reader.empty()) { // Read the next section from the bytecode. bytecode::Section::ID sectionID; @@ -1389,8 +1390,8 @@ FailureOr BytecodeReader::parseOpName(EncodingReader &reader) { // Resource Section LogicalResult BytecodeReader::parseResourceSection( - Optional> resourceData, - Optional> resourceOffsetData) { + std::optional> resourceData, + std::optional> resourceOffsetData) { // Ensure both sections are either present or not. if (resourceData.has_value() != resourceOffsetData.has_value()) { if (resourceOffsetData) -- cgit v1.1