[ADT] Use std::optional in TypeSwitch.h (NFC)
authorKazu Hirata <kazu@google.com>
Sun, 27 Nov 2022 19:48:57 +0000 (11:48 -0800)
committerKazu Hirata <kazu@google.com>
Sun, 27 Nov 2022 19:48:57 +0000 (11:48 -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/ADT/TypeSwitch.h

index cf58808..044b243 100644 (file)
@@ -18,6 +18,7 @@
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Support/Casting.h"
+#include <optional>
 
 namespace llvm {
 namespace detail {
@@ -145,7 +146,7 @@ public:
 private:
   /// The pointer to the result of this switch statement, once known,
   /// null before that.
-  Optional<ResultT> result;
+  std::optional<ResultT> result;
 };
 
 /// Specialization of TypeSwitch for void returning callables.