From f4c16c44737caac25bf09ec2d85809820579ae40 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 4 Dec 2022 21:36:08 +0000 Subject: [MC] llvm::Optional => std::optional https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716 --- .../WebAssembly/Disassembler/WebAssemblyDisassembler.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'llvm/lib/Target/WebAssembly/Disassembler/WebAssemblyDisassembler.cpp') 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 Bytes, uint64_t Address, raw_ostream &CStream) const override; - Optional onSymbolStart(SymbolInfoTy &Symbol, uint64_t &Size, - ArrayRef Bytes, - uint64_t Address, - raw_ostream &CStream) const override; + std::optional + onSymbolStart(SymbolInfoTy &Symbol, uint64_t &Size, ArrayRef 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 Bytes) { return true; } -Optional WebAssemblyDisassembler::onSymbolStart( - SymbolInfoTy &Symbol, uint64_t &Size, ArrayRef Bytes, - uint64_t Address, raw_ostream &CStream) const { +std::optional +WebAssemblyDisassembler::onSymbolStart(SymbolInfoTy &Symbol, uint64_t &Size, + ArrayRef 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. -- cgit v1.1