@@ -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:
@@ -6247,6 +6248,7 @@ lldb::TypeClass SwiftASTContext::GetTypeClass(opaque_compiler_type_t type) {
6247
6248
case swift::TypeKind::BuiltinPackIndex:
6248
6249
case swift::TypeKind::BuiltinTuple:
6249
6250
case swift::TypeKind::BuiltinUnboundGeneric:
6251
+ case swift::TypeKind::Locatable:
6250
6252
case swift::TypeKind::Integer:
6251
6253
case swift::TypeKind::Pack:
6252
6254
case swift::TypeKind::PackElement:
@@ -6745,6 +6747,7 @@ lldb::Encoding SwiftASTContext::GetEncoding(opaque_compiler_type_t type,
6745
6747
case swift::TypeKind::BuiltinRawUnsafeContinuation:
6746
6748
case swift::TypeKind::Error:
6747
6749
case swift::TypeKind::InOut:
6750
+ case swift::TypeKind::Locatable:
6748
6751
case swift::TypeKind::Module:
6749
6752
case swift::TypeKind::BuiltinPackIndex:
6750
6753
case swift::TypeKind::Pack:
@@ -6870,6 +6873,7 @@ SwiftASTContext::GetNumChildren(opaque_compiler_type_t type,
6870
6873
case swift::TypeKind::GenericTypeParam:
6871
6874
case swift::TypeKind::InOut:
6872
6875
case swift::TypeKind::Integer:
6876
+ case swift::TypeKind::Locatable:
6873
6877
case swift::TypeKind::Metatype:
6874
6878
case swift::TypeKind::Module:
6875
6879
case swift::TypeKind::OpaqueTypeArchetype:
@@ -7004,6 +7008,7 @@ uint32_t SwiftASTContext::GetNumFields(opaque_compiler_type_t type,
7004
7008
case swift::TypeKind::ErrorUnion:
7005
7009
case swift::TypeKind::InOut:
7006
7010
case swift::TypeKind::Integer:
7011
+ case swift::TypeKind::Locatable:
7007
7012
case swift::TypeKind::Module:
7008
7013
case swift::TypeKind::Pack:
7009
7014
case swift::TypeKind::PackArchetype:
@@ -7235,6 +7240,7 @@ CompilerType SwiftASTContext::GetFieldAtIndex(opaque_compiler_type_t type,
7235
7240
case swift::TypeKind::ErrorUnion:
7236
7241
case swift::TypeKind::InOut:
7237
7242
case swift::TypeKind::Integer:
7243
+ case swift::TypeKind::Locatable:
7238
7244
case swift::TypeKind::Module:
7239
7245
case swift::TypeKind::Pack:
7240
7246
case swift::TypeKind::PackArchetype:
@@ -7442,6 +7448,7 @@ uint32_t SwiftASTContext::GetNumPointeeChildren(opaque_compiler_type_t type) {
7442
7448
case swift::TypeKind::GenericTypeParam:
7443
7449
case swift::TypeKind::InOut:
7444
7450
case swift::TypeKind::Integer:
7451
+ case swift::TypeKind::Locatable:
7445
7452
case swift::TypeKind::Metatype:
7446
7453
case swift::TypeKind::Module:
7447
7454
case swift::TypeKind::OpaqueTypeArchetype:
@@ -7602,6 +7609,7 @@ llvm::Expected<CompilerType> SwiftASTContext::GetChildCompilerTypeAtIndex(
7602
7609
case swift::TypeKind::GenericTypeParam:
7603
7610
case swift::TypeKind::InOut:
7604
7611
case swift::TypeKind::Integer:
7612
+ case swift::TypeKind::Locatable:
7605
7613
case swift::TypeKind::Metatype:
7606
7614
case swift::TypeKind::Module:
7607
7615
case swift::TypeKind::OpaqueTypeArchetype:
@@ -7952,6 +7960,7 @@ size_t SwiftASTContext::GetIndexOfChildMemberWithName(
7952
7960
case swift::TypeKind::GenericFunction:
7953
7961
case swift::TypeKind::InOut:
7954
7962
case swift::TypeKind::Integer:
7963
+ case swift::TypeKind::Locatable:
7955
7964
case swift::TypeKind::Metatype:
7956
7965
case swift::TypeKind::Module:
7957
7966
case swift::TypeKind::OpaqueTypeArchetype:
@@ -8194,8 +8203,7 @@ SwiftASTContext::GetGenericArgumentKind(opaque_compiler_type_t type,
8194
8203
size_t idx) {
8195
8204
VALID_OR_RETURN_CHECK_TYPE (type, eNullGenericKindType);
8196
8205
swift::CanType swift_can_type (GetCanonicalSwiftType (type));
8197
- if (auto *unbound_generic_type =
8198
- swift_can_type->getAs <swift::UnboundGenericType>())
8206
+ if (swift_can_type->getAs <swift::UnboundGenericType>())
8199
8207
return eUnboundGenericKindType;
8200
8208
if (auto *bound_generic_type =
8201
8209
swift_can_type->getAs <swift::BoundGenericType>())
@@ -8307,8 +8315,6 @@ bool SwiftASTContext::IsMeaninglessWithoutDynamicResolution(
8307
8315
// ----------------------------------------------------------------------
8308
8316
// Dumping types
8309
8317
// ----------------------------------------------------------------------
8310
- #define DEPTH_INCREMENT 2
8311
-
8312
8318
#ifndef NDEBUG
8313
8319
LLVM_DUMP_METHOD void SwiftASTContext::dump (opaque_compiler_type_t type) const {
8314
8320
if (!type)
@@ -8348,6 +8354,7 @@ bool SwiftASTContext::DumpTypeValue(
8348
8354
case swift::TypeKind::Existential:
8349
8355
case swift::TypeKind::InOut:
8350
8356
case swift::TypeKind::Integer:
8357
+ case swift::TypeKind::Locatable:
8351
8358
case swift::TypeKind::Module:
8352
8359
case swift::TypeKind::Pack:
8353
8360
case swift::TypeKind::PackArchetype:
0 commit comments