[IR] Use std::optional in InstrTypes.h (NFC)
authorKazu Hirata <kazu@google.com>
Sun, 27 Nov 2022 22:40:05 +0000 (14:40 -0800)
committerKazu Hirata <kazu@google.com>
Sun, 27 Nov 2022 22:40:05 +0000 (14:40 -0800)
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

llvm/include/llvm/IR/InstrTypes.h

index da081d0..fe63344 100644 (file)
@@ -36,6 +36,7 @@
 #include <cstddef>
 #include <cstdint>
 #include <iterator>
+#include <optional>
 #include <string>
 #include <vector>
 
@@ -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<OperandBundleUse> getOperandBundle(StringRef Name) const {
+  std::optional<OperandBundleUse> getOperandBundle(StringRef Name) const {
     assert(countOperandBundlesOfType(Name) < 2 && "Precondition violated!");
 
     for (unsigned i = 0, e = getNumOperandBundles(); i != e; ++i) {