From: Kazu Hirata Date: Sat, 26 Nov 2022 06:14:44 +0000 (-0800) Subject: [AsmParser] Use std::optional in AArch64AsmParser.cpp (NFC) X-Git-Tag: upstream/17.0.6~26467 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fc07a54ef674365a934a1c880f24c2e5145b25cb;p=platform%2Fupstream%2Fllvm.git [AsmParser] Use std::optional in AArch64AsmParser.cpp (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 --- diff --git a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp index 9cf92e7..895748e 100644 --- a/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp +++ b/llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -938,7 +939,7 @@ public: /// a shifted immediate by value 'Shift' or '0', or if it is an unshifted /// immediate that can be shifted by 'Shift'. template - Optional > getShiftedVal() const { + std::optional> getShiftedVal() const { if (isShiftedImm() && Width == getShiftedImmShift()) if (auto *CE = dyn_cast(getShiftedImmVal())) return std::make_pair(CE->getValue(), Width);