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:
Ben Barham
2024-02-02 22:19:39 -08:00
parent d3d4bd203c
commit ef8825bfe6
810 changed files with 8035 additions and 8718 deletions

View File

@@ -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) {