mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Migrate llvm::Optional to std::optional
LLVM has removed llvm::Optional, move over to std::optional. Also clang-format to fix up all the renamed #includes.
This commit is contained in:
@@ -1060,11 +1060,11 @@ bool ModuleFileSharedCore::readCommentBlock(llvm::BitstreamCursor &cursor) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static llvm::Optional<swift::LibraryKind>
|
||||
static std::optional<swift::LibraryKind>
|
||||
getActualLibraryKind(unsigned rawKind) {
|
||||
auto stableKind = static_cast<serialization::LibraryKind>(rawKind);
|
||||
if (stableKind != rawKind)
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
|
||||
switch (stableKind) {
|
||||
case serialization::LibraryKind::Library:
|
||||
@@ -1074,10 +1074,10 @@ getActualLibraryKind(unsigned rawKind) {
|
||||
}
|
||||
|
||||
// If there's a new case value in the module file, ignore it.
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
static llvm::Optional<ModuleDecl::ImportFilterKind>
|
||||
static std::optional<ModuleDecl::ImportFilterKind>
|
||||
getActualImportControl(unsigned rawValue) {
|
||||
// We switch on the raw value rather than the enum in order to handle future
|
||||
// values.
|
||||
@@ -1093,7 +1093,7 @@ getActualImportControl(unsigned rawValue) {
|
||||
case static_cast<unsigned>(serialization::ImportControl::PackageOnly):
|
||||
return ModuleDecl::ImportFilterKind::PackageOnly;
|
||||
default:
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user