@@ -3889,7 +3889,7 @@ llvm::Expected<swift::ModuleDecl &> SwiftASTContext::CreateModule(
3889
3889
if (module_name.empty ())
3890
3890
return llvm::createStringError (" invalid module name (empty)" );
3891
3891
3892
- if (swift::ModuleDecl *module_decl = GetCachedModule (module_name))
3892
+ if (GetCachedModule (module_name))
3893
3893
return llvm::createStringError (
3894
3894
llvm::formatv (" module already exists for \" {0}\" " , module_name));
3895
3895
@@ -4653,7 +4653,7 @@ void SwiftASTContext::CacheDemangledTypeFailure(ConstString name) {
4653
4653
// / specializations.
4654
4654
static swift::Type ConvertSILFunctionTypesToASTFunctionTypes (swift::Type t) {
4655
4655
return t.transformRec ([](swift::TypeBase *t) -> std::optional<swift::Type> {
4656
- if (auto *silFn = swift::dyn_cast<swift::SILFunctionType>(t)) {
4656
+ if (swift::dyn_cast<swift::SILFunctionType>(t)) {
4657
4657
// FIXME: Verify ExtInfo state is correct, not working by accident.
4658
4658
swift::FunctionType::ExtInfo info;
4659
4659
return swift::Type (
@@ -6093,6 +6093,7 @@ SwiftASTContext::GetTypeInfo(opaque_compiler_type_t type,
6093
6093
case swift::TypeKind::ErrorUnion:
6094
6094
case swift::TypeKind::InOut:
6095
6095
case swift::TypeKind::Integer:
6096
+ case swift::TypeKind::Locatable:
6096
6097
case swift::TypeKind::Module:
6097
6098
case swift::TypeKind::OpenedArchetype:
6098
6099
case swift::TypeKind::ParameterizedProtocol:
@@ -6254,6 +6255,7 @@ lldb::TypeClass SwiftASTContext::GetTypeClass(opaque_compiler_type_t type) {
6254
6255
case swift::TypeKind::BuiltinPackIndex:
6255
6256
case swift::TypeKind::BuiltinTuple:
6256
6257
case swift::TypeKind::BuiltinUnboundGeneric:
6258
+ case swift::TypeKind::Locatable:
6257
6259
case swift::TypeKind::Integer:
6258
6260
case swift::TypeKind::Pack:
6259
6261
case swift::TypeKind::PackElement:
@@ -6752,6 +6754,7 @@ lldb::Encoding SwiftASTContext::GetEncoding(opaque_compiler_type_t type,
6752
6754
case swift::TypeKind::BuiltinRawUnsafeContinuation:
6753
6755
case swift::TypeKind::Error:
6754
6756
case swift::TypeKind::InOut:
6757
+ case swift::TypeKind::Locatable:
6755
6758
case swift::TypeKind::Module:
6756
6759
case swift::TypeKind::BuiltinPackIndex:
6757
6760
case swift::TypeKind::Pack:
@@ -6877,6 +6880,7 @@ SwiftASTContext::GetNumChildren(opaque_compiler_type_t type,
6877
6880
case swift::TypeKind::GenericTypeParam:
6878
6881
case swift::TypeKind::InOut:
6879
6882
case swift::TypeKind::Integer:
6883
+ case swift::TypeKind::Locatable:
6880
6884
case swift::TypeKind::Metatype:
6881
6885
case swift::TypeKind::Module:
6882
6886
case swift::TypeKind::OpaqueTypeArchetype:
@@ -7011,6 +7015,7 @@ uint32_t SwiftASTContext::GetNumFields(opaque_compiler_type_t type,
7011
7015
case swift::TypeKind::ErrorUnion:
7012
7016
case swift::TypeKind::InOut:
7013
7017
case swift::TypeKind::Integer:
7018
+ case swift::TypeKind::Locatable:
7014
7019
case swift::TypeKind::Module:
7015
7020
case swift::TypeKind::Pack:
7016
7021
case swift::TypeKind::PackArchetype:
@@ -7242,6 +7247,7 @@ CompilerType SwiftASTContext::GetFieldAtIndex(opaque_compiler_type_t type,
7242
7247
case swift::TypeKind::ErrorUnion:
7243
7248
case swift::TypeKind::InOut:
7244
7249
case swift::TypeKind::Integer:
7250
+ case swift::TypeKind::Locatable:
7245
7251
case swift::TypeKind::Module:
7246
7252
case swift::TypeKind::Pack:
7247
7253
case swift::TypeKind::PackArchetype:
@@ -7449,6 +7455,7 @@ uint32_t SwiftASTContext::GetNumPointeeChildren(opaque_compiler_type_t type) {
7449
7455
case swift::TypeKind::GenericTypeParam:
7450
7456
case swift::TypeKind::InOut:
7451
7457
case swift::TypeKind::Integer:
7458
+ case swift::TypeKind::Locatable:
7452
7459
case swift::TypeKind::Metatype:
7453
7460
case swift::TypeKind::Module:
7454
7461
case swift::TypeKind::OpaqueTypeArchetype:
@@ -7609,6 +7616,7 @@ llvm::Expected<CompilerType> SwiftASTContext::GetChildCompilerTypeAtIndex(
7609
7616
case swift::TypeKind::GenericTypeParam:
7610
7617
case swift::TypeKind::InOut:
7611
7618
case swift::TypeKind::Integer:
7619
+ case swift::TypeKind::Locatable:
7612
7620
case swift::TypeKind::Metatype:
7613
7621
case swift::TypeKind::Module:
7614
7622
case swift::TypeKind::OpaqueTypeArchetype:
@@ -7959,6 +7967,7 @@ size_t SwiftASTContext::GetIndexOfChildMemberWithName(
7959
7967
case swift::TypeKind::GenericFunction:
7960
7968
case swift::TypeKind::InOut:
7961
7969
case swift::TypeKind::Integer:
7970
+ case swift::TypeKind::Locatable:
7962
7971
case swift::TypeKind::Metatype:
7963
7972
case swift::TypeKind::Module:
7964
7973
case swift::TypeKind::OpaqueTypeArchetype:
@@ -8201,8 +8210,7 @@ SwiftASTContext::GetGenericArgumentKind(opaque_compiler_type_t type,
8201
8210
size_t idx) {
8202
8211
VALID_OR_RETURN_CHECK_TYPE (type, eNullGenericKindType);
8203
8212
swift::CanType swift_can_type (GetCanonicalSwiftType (type));
8204
- if (auto *unbound_generic_type =
8205
- swift_can_type->getAs <swift::UnboundGenericType>())
8213
+ if (swift_can_type->getAs <swift::UnboundGenericType>())
8206
8214
return eUnboundGenericKindType;
8207
8215
if (auto *bound_generic_type =
8208
8216
swift_can_type->getAs <swift::BoundGenericType>())
@@ -8314,8 +8322,6 @@ bool SwiftASTContext::IsMeaninglessWithoutDynamicResolution(
8314
8322
// ----------------------------------------------------------------------
8315
8323
// Dumping types
8316
8324
// ----------------------------------------------------------------------
8317
- #define DEPTH_INCREMENT 2
8318
-
8319
8325
#ifndef NDEBUG
8320
8326
LLVM_DUMP_METHOD void SwiftASTContext::dump (opaque_compiler_type_t type) const {
8321
8327
if (!type)
@@ -8355,6 +8361,7 @@ bool SwiftASTContext::DumpTypeValue(
8355
8361
case swift::TypeKind::Existential:
8356
8362
case swift::TypeKind::InOut:
8357
8363
case swift::TypeKind::Integer:
8364
+ case swift::TypeKind::Locatable:
8358
8365
case swift::TypeKind::Module:
8359
8366
case swift::TypeKind::Pack:
8360
8367
case swift::TypeKind::PackArchetype:
0 commit comments