[llvm] 74151a2 - [Support] Use std::optional in HashBuilder.h (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 27 14:16:25 PST 2022


Author: Kazu Hirata
Date: 2022-11-27T14:16:06-08:00
New Revision: 74151a2388e141f42d71e7cbdb7e5c59088d9382

URL: https://github.com/llvm/llvm-project/commit/74151a2388e141f42d71e7cbdb7e5c59088d9382
DIFF: https://github.com/llvm/llvm-project/commit/74151a2388e141f42d71e7cbdb7e5c59088d9382.diff

LOG: [Support] Use std::optional in HashBuilder.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

Added: 
    

Modified: 
    llvm/include/llvm/Support/HashBuilder.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Support/HashBuilder.h b/llvm/include/llvm/Support/HashBuilder.h
index 5df0bc20c7d6..d2b47c855a5a 100644
--- a/llvm/include/llvm/Support/HashBuilder.h
+++ b/llvm/include/llvm/Support/HashBuilder.h
@@ -23,6 +23,7 @@
 #include "llvm/Support/type_traits.h"
 
 #include <iterator>
+#include <optional>
 #include <utility>
 
 namespace llvm {
@@ -80,7 +81,7 @@ template <typename HasherT> class HashBuilderBase {
         Hasher(*OptionalHasher) {}
 
 private:
-  Optional<HasherT> OptionalHasher;
+  std::optional<HasherT> OptionalHasher;
   HasherT &Hasher;
 };
 


        


More information about the llvm-commits mailing list