mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +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:
@@ -19,7 +19,7 @@ using namespace swift::ide;
|
||||
|
||||
using ChunkKind = CodeCompletionString::Chunk::ChunkKind;
|
||||
|
||||
llvm::Optional<ChunkKind>
|
||||
std::optional<ChunkKind>
|
||||
CodeCompletionStringPrinter::getChunkKindForPrintNameContext(
|
||||
PrintNameContext context) const {
|
||||
switch (context) {
|
||||
@@ -34,26 +34,26 @@ CodeCompletionStringPrinter::getChunkKindForPrintNameContext(
|
||||
return ChunkKind::Attribute;
|
||||
case PrintNameContext::FunctionParameterExternal:
|
||||
if (isInType()) {
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
}
|
||||
return ChunkKind::ParameterDeclExternalName;
|
||||
case PrintNameContext::FunctionParameterLocal:
|
||||
if (isInType()) {
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
}
|
||||
return ChunkKind::ParameterDeclLocalName;
|
||||
default:
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
llvm::Optional<ChunkKind>
|
||||
std::optional<ChunkKind>
|
||||
CodeCompletionStringPrinter::getChunkKindForStructureKind(
|
||||
PrintStructureKind Kind) const {
|
||||
switch (Kind) {
|
||||
case PrintStructureKind::FunctionParameter:
|
||||
if (isInType()) {
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
}
|
||||
return ChunkKind::ParameterDeclBegin;
|
||||
case PrintStructureKind::DefaultArgumentClause:
|
||||
@@ -69,7 +69,7 @@ CodeCompletionStringPrinter::getChunkKindForStructureKind(
|
||||
case PrintStructureKind::FunctionParameterType:
|
||||
return ChunkKind::ParameterDeclTypeBegin;
|
||||
default:
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user