From: Kazu Hirata Date: Sun, 27 Nov 2022 22:40:05 +0000 (-0800) Subject: [IR] Use std::optional in InstrTypes.h (NFC) X-Git-Tag: upstream/17.0.6~26291 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6fd5c0b76a0c4e0ae189ac3064d1e279b66fd86c;p=platform%2Fupstream%2Fllvm.git [IR] Use std::optional in InstrTypes.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 --- diff --git a/llvm/include/llvm/IR/InstrTypes.h b/llvm/include/llvm/IR/InstrTypes.h index da081d0..fe63344 100644 --- a/llvm/include/llvm/IR/InstrTypes.h +++ b/llvm/include/llvm/IR/InstrTypes.h @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -2014,7 +2015,7 @@ public: /// /// It is an error to call this for operand bundle types that may have /// multiple instances of them on the same instruction. - Optional getOperandBundle(StringRef Name) const { + std::optional getOperandBundle(StringRef Name) const { assert(countOperandBundlesOfType(Name) < 2 && "Precondition violated!"); for (unsigned i = 0, e = getNumOperandBundles(); i != e; ++i) {