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

index 4bcf21e..e8a9a3b 100644 (file)
@@ -38,6 +38,7 @@
 #include <cstdint>
 #include <map>
 #include <memory>
+#include <optional>
 #include <set>
 #include <string>
 #include <utility>
@@ -1700,7 +1701,7 @@ public:
 
   /// For the given \p TypeId, this returns the TypeIdCompatibleVtableMap
   /// entry if present in the summary map. This may be used when importing.
-  Optional<TypeIdCompatibleVtableInfo>
+  std::optional<TypeIdCompatibleVtableInfo>
   getTypeIdCompatibleVtableSummary(StringRef TypeId) const {
     auto I = TypeIdCompatibleVtableMap.find(TypeId);
     if (I == TypeIdCompatibleVtableMap.end())