diff options
author | Kazu Hirata <kazu@google.com> | 2022-12-02 20:36:06 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-12-02 20:36:06 -0800 |
commit | 20cde15415d2b2d1b489b4cd5c520c6a8d7f8f54 (patch) | |
tree | 816f0095aee7a3575f0006ae3a215d0ee9558a6f /llvm/lib/Target/WebAssembly/Disassembler/WebAssemblyDisassembler.cpp | |
parent | e9e64f7c9e8af778faa62d1b412f190bb3e85f3c (diff) | |
download | llvm-20cde15415d2b2d1b489b4cd5c520c6a8d7f8f54.zip llvm-20cde15415d2b2d1b489b4cd5c520c6a8d7f8f54.tar.gz llvm-20cde15415d2b2d1b489b4cd5c520c6a8d7f8f54.tar.bz2 |
[Target] Use std::nullopt instead of None (NFC)
This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated. The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.
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 'llvm/lib/Target/WebAssembly/Disassembler/WebAssemblyDisassembler.cpp')
-rw-r--r-- | llvm/lib/Target/WebAssembly/Disassembler/WebAssemblyDisassembler.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/WebAssembly/Disassembler/WebAssemblyDisassembler.cpp b/llvm/lib/Target/WebAssembly/Disassembler/WebAssemblyDisassembler.cpp index ae65a9d..87dfeba 100644 --- a/llvm/lib/Target/WebAssembly/Disassembler/WebAssemblyDisassembler.cpp +++ b/llvm/lib/Target/WebAssembly/Disassembler/WebAssemblyDisassembler.cpp @@ -129,21 +129,21 @@ Optional<MCDisassembler::DecodeStatus> WebAssemblyDisassembler::onSymbolStart( // Start of a code section: we're parsing only the function count. int64_t FunctionCount; if (!nextLEB(FunctionCount, Bytes, Size, false)) - return None; + return std::nullopt; outs() << " # " << FunctionCount << " functions in section."; } else { // Parse the start of a single function. int64_t BodySize, LocalEntryCount; if (!nextLEB(BodySize, Bytes, Size, false) || !nextLEB(LocalEntryCount, Bytes, Size, false)) - return None; + return std::nullopt; if (LocalEntryCount) { outs() << " .local "; for (int64_t I = 0; I < LocalEntryCount; I++) { int64_t Count, Type; if (!nextLEB(Count, Bytes, Size, false) || !nextLEB(Type, Bytes, Size, false)) - return None; + return std::nullopt; for (int64_t J = 0; J < Count; J++) { if (I || J) outs() << ", "; |