diff options
author | Fangrui Song <i@maskray.me> | 2022-12-04 21:36:08 +0000 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2022-12-04 21:36:08 +0000 |
commit | f4c16c44737caac25bf09ec2d85809820579ae40 (patch) | |
tree | 4eae73487985fbe84f3b64a5be5ac52c88ff0cbb /llvm/lib/Target/WebAssembly/Disassembler/WebAssemblyDisassembler.cpp | |
parent | 12f6ac39bcc0957d66b68650fb830e12fb15b3a1 (diff) | |
download | llvm-f4c16c44737caac25bf09ec2d85809820579ae40.zip llvm-f4c16c44737caac25bf09ec2d85809820579ae40.tar.gz llvm-f4c16c44737caac25bf09ec2d85809820579ae40.tar.bz2 |
[MC] llvm::Optional => 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 | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/Target/WebAssembly/Disassembler/WebAssemblyDisassembler.cpp b/llvm/lib/Target/WebAssembly/Disassembler/WebAssemblyDisassembler.cpp index 87dfeba..1f07b16 100644 --- a/llvm/lib/Target/WebAssembly/Disassembler/WebAssemblyDisassembler.cpp +++ b/llvm/lib/Target/WebAssembly/Disassembler/WebAssemblyDisassembler.cpp @@ -45,10 +45,9 @@ class WebAssemblyDisassembler final : public MCDisassembler { DecodeStatus getInstruction(MCInst &Instr, uint64_t &Size, ArrayRef<uint8_t> Bytes, uint64_t Address, raw_ostream &CStream) const override; - Optional<DecodeStatus> onSymbolStart(SymbolInfoTy &Symbol, uint64_t &Size, - ArrayRef<uint8_t> Bytes, - uint64_t Address, - raw_ostream &CStream) const override; + std::optional<DecodeStatus> + onSymbolStart(SymbolInfoTy &Symbol, uint64_t &Size, ArrayRef<uint8_t> Bytes, + uint64_t Address, raw_ostream &CStream) const override; public: WebAssemblyDisassembler(const MCSubtargetInfo &STI, MCContext &Ctx, @@ -121,9 +120,11 @@ bool parseImmediate(MCInst &MI, uint64_t &Size, ArrayRef<uint8_t> Bytes) { return true; } -Optional<MCDisassembler::DecodeStatus> WebAssemblyDisassembler::onSymbolStart( - SymbolInfoTy &Symbol, uint64_t &Size, ArrayRef<uint8_t> Bytes, - uint64_t Address, raw_ostream &CStream) const { +std::optional<MCDisassembler::DecodeStatus> +WebAssemblyDisassembler::onSymbolStart(SymbolInfoTy &Symbol, uint64_t &Size, + ArrayRef<uint8_t> Bytes, + uint64_t Address, + raw_ostream &CStream) const { Size = 0; if (Address == 0) { // Start of a code section: we're parsing only the function count. |