[llvm] 37597e8 - [BinaryFormat] Use std::optional in Wasm.h (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Dec 10 08:18:10 PST 2022
Author: Kazu Hirata
Date: 2022-12-10T08:18:04-08:00
New Revision: 37597e8450be1efa0212050a965c490f4fb5f0bc
URL: https://github.com/llvm/llvm-project/commit/37597e8450be1efa0212050a965c490f4fb5f0bc
DIFF: https://github.com/llvm/llvm-project/commit/37597e8450be1efa0212050a965c490f4fb5f0bc.diff
LOG: [BinaryFormat] Use std::optional in Wasm.h (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/include/llvm/BinaryFormat/Wasm.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/BinaryFormat/Wasm.h b/llvm/include/llvm/BinaryFormat/Wasm.h
index 62a6881ef36a..eebd2aa2746a 100644
--- a/llvm/include/llvm/BinaryFormat/Wasm.h
+++ b/llvm/include/llvm/BinaryFormat/Wasm.h
@@ -18,6 +18,7 @@
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
+#include <optional>
namespace llvm {
namespace wasm {
@@ -152,7 +153,7 @@ struct WasmFunction {
uint32_t CodeSectionOffset;
uint32_t Size;
uint32_t CodeOffset; // start of Locals and Body
- Optional<StringRef> ExportName; // from the "export" section
+ std::optional<StringRef> ExportName; // from the "export" section
StringRef SymbolName; // from the "linking" section
StringRef DebugName; // from the "name" section
uint32_t Comdat; // from the "comdat info" section
More information about the llvm-commits
mailing list