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:
@@ -775,7 +775,7 @@ swift::ide::NameKind SwiftLangSupport::getNameKindForUID(SourceKit::UIdent Id) {
|
||||
return swift::ide::NameKind::Swift;
|
||||
}
|
||||
|
||||
llvm::Optional<UIdent>
|
||||
std::optional<UIdent>
|
||||
SwiftLangSupport::getUIDForDeclAttribute(const swift::DeclAttribute *Attr) {
|
||||
// Check special-case names first.
|
||||
switch (Attr->getKind()) {
|
||||
@@ -843,7 +843,7 @@ SwiftLangSupport::getUIDForDeclAttribute(const swift::DeclAttribute *Attr) {
|
||||
case DeclAttrKind::RawDocComment:
|
||||
case DeclAttrKind::HasInitialValue:
|
||||
case DeclAttrKind::HasStorage:
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -857,7 +857,7 @@ SwiftLangSupport::getUIDForDeclAttribute(const swift::DeclAttribute *Attr) {
|
||||
#include "swift/AST/DeclAttr.def"
|
||||
}
|
||||
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
UIdent SwiftLangSupport::getUIDForFormalAccessScope(const swift::AccessScope Scope) {
|
||||
@@ -1005,8 +1005,8 @@ void SwiftLangSupport::setFileSystemProvider(
|
||||
}
|
||||
|
||||
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>
|
||||
SwiftLangSupport::getFileSystem(const llvm::Optional<VFSOptions> &vfsOptions,
|
||||
llvm::Optional<StringRef> primaryFile,
|
||||
SwiftLangSupport::getFileSystem(const std::optional<VFSOptions> &vfsOptions,
|
||||
std::optional<StringRef> primaryFile,
|
||||
std::string &error) {
|
||||
// First, try the specified vfsOptions.
|
||||
if (vfsOptions) {
|
||||
|
||||
Reference in New Issue
Block a user