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

index 5df0bc2..d2b47c8 100644 (file)
@@ -23,6 +23,7 @@
 #include "llvm/Support/type_traits.h"
 
 #include <iterator>
+#include <optional>
 #include <utility>
 
 namespace llvm {
@@ -80,7 +81,7 @@ protected:
         Hasher(*OptionalHasher) {}
 
 private:
-  Optional<HasherT> OptionalHasher;
+  std::optional<HasherT> OptionalHasher;
   HasherT &Hasher;
 };