[llvm] f9b93cf - [IR] Use std::optional in ModuleSummaryIndex.h (NFC)

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


Author: Kazu Hirata
Date: 2022-11-27T14:40:08-08:00
New Revision: f9b93cf3344c53f1a5c071b61430694a924570c7

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

LOG: [IR] Use std::optional in ModuleSummaryIndex.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/IR/ModuleSummaryIndex.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/IR/ModuleSummaryIndex.h b/llvm/include/llvm/IR/ModuleSummaryIndex.h
index 4bcf21edfecb..e8a9a3b31b1b 100644
--- a/llvm/include/llvm/IR/ModuleSummaryIndex.h
+++ b/llvm/include/llvm/IR/ModuleSummaryIndex.h
@@ -38,6 +38,7 @@
 #include <cstdint>
 #include <map>
 #include <memory>
+#include <optional>
 #include <set>
 #include <string>
 #include <utility>
@@ -1700,7 +1701,7 @@ class ModuleSummaryIndex {
 
   /// 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())


        


More information about the llvm-commits mailing list