@@ -3889,7 +3889,7 @@ llvm::Expected<swift::ModuleDecl &> SwiftASTContext::CreateModule(
38893889 if (module_name.empty ())
38903890 return llvm::createStringError (" invalid module name (empty)" );
38913891
3892- if (swift::ModuleDecl *module_decl = GetCachedModule (module_name))
3892+ if (GetCachedModule (module_name))
38933893 return llvm::createStringError (
38943894 llvm::formatv (" module already exists for \" {0}\" " , module_name));
38953895
@@ -4653,7 +4653,7 @@ void SwiftASTContext::CacheDemangledTypeFailure(ConstString name) {
46534653// / specializations.
46544654static swift::Type ConvertSILFunctionTypesToASTFunctionTypes (swift::Type t) {
46554655 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)) {
46574657 // FIXME: Verify ExtInfo state is correct, not working by accident.
46584658 swift::FunctionType::ExtInfo info;
46594659 return swift::Type (
@@ -6093,6 +6093,7 @@ SwiftASTContext::GetTypeInfo(opaque_compiler_type_t type,
60936093 case swift::TypeKind::ErrorUnion:
60946094 case swift::TypeKind::InOut:
60956095 case swift::TypeKind::Integer:
6096+ case swift::TypeKind::Locatable:
60966097 case swift::TypeKind::Module:
60976098 case swift::TypeKind::OpenedArchetype:
60986099 case swift::TypeKind::ParameterizedProtocol:
@@ -6247,6 +6248,7 @@ lldb::TypeClass SwiftASTContext::GetTypeClass(opaque_compiler_type_t type) {
62476248 case swift::TypeKind::BuiltinPackIndex:
62486249 case swift::TypeKind::BuiltinTuple:
62496250 case swift::TypeKind::BuiltinUnboundGeneric:
6251+ case swift::TypeKind::Locatable:
62506252 case swift::TypeKind::Integer:
62516253 case swift::TypeKind::Pack:
62526254 case swift::TypeKind::PackElement:
@@ -6745,6 +6747,7 @@ lldb::Encoding SwiftASTContext::GetEncoding(opaque_compiler_type_t type,
67456747 case swift::TypeKind::BuiltinRawUnsafeContinuation:
67466748 case swift::TypeKind::Error:
67476749 case swift::TypeKind::InOut:
6750+ case swift::TypeKind::Locatable:
67486751 case swift::TypeKind::Module:
67496752 case swift::TypeKind::BuiltinPackIndex:
67506753 case swift::TypeKind::Pack:
@@ -6870,6 +6873,7 @@ SwiftASTContext::GetNumChildren(opaque_compiler_type_t type,
68706873 case swift::TypeKind::GenericTypeParam:
68716874 case swift::TypeKind::InOut:
68726875 case swift::TypeKind::Integer:
6876+ case swift::TypeKind::Locatable:
68736877 case swift::TypeKind::Metatype:
68746878 case swift::TypeKind::Module:
68756879 case swift::TypeKind::OpaqueTypeArchetype:
@@ -7004,6 +7008,7 @@ uint32_t SwiftASTContext::GetNumFields(opaque_compiler_type_t type,
70047008 case swift::TypeKind::ErrorUnion:
70057009 case swift::TypeKind::InOut:
70067010 case swift::TypeKind::Integer:
7011+ case swift::TypeKind::Locatable:
70077012 case swift::TypeKind::Module:
70087013 case swift::TypeKind::Pack:
70097014 case swift::TypeKind::PackArchetype:
@@ -7235,6 +7240,7 @@ CompilerType SwiftASTContext::GetFieldAtIndex(opaque_compiler_type_t type,
72357240 case swift::TypeKind::ErrorUnion:
72367241 case swift::TypeKind::InOut:
72377242 case swift::TypeKind::Integer:
7243+ case swift::TypeKind::Locatable:
72387244 case swift::TypeKind::Module:
72397245 case swift::TypeKind::Pack:
72407246 case swift::TypeKind::PackArchetype:
@@ -7442,6 +7448,7 @@ uint32_t SwiftASTContext::GetNumPointeeChildren(opaque_compiler_type_t type) {
74427448 case swift::TypeKind::GenericTypeParam:
74437449 case swift::TypeKind::InOut:
74447450 case swift::TypeKind::Integer:
7451+ case swift::TypeKind::Locatable:
74457452 case swift::TypeKind::Metatype:
74467453 case swift::TypeKind::Module:
74477454 case swift::TypeKind::OpaqueTypeArchetype:
@@ -7602,6 +7609,7 @@ llvm::Expected<CompilerType> SwiftASTContext::GetChildCompilerTypeAtIndex(
76027609 case swift::TypeKind::GenericTypeParam:
76037610 case swift::TypeKind::InOut:
76047611 case swift::TypeKind::Integer:
7612+ case swift::TypeKind::Locatable:
76057613 case swift::TypeKind::Metatype:
76067614 case swift::TypeKind::Module:
76077615 case swift::TypeKind::OpaqueTypeArchetype:
@@ -7952,6 +7960,7 @@ size_t SwiftASTContext::GetIndexOfChildMemberWithName(
79527960 case swift::TypeKind::GenericFunction:
79537961 case swift::TypeKind::InOut:
79547962 case swift::TypeKind::Integer:
7963+ case swift::TypeKind::Locatable:
79557964 case swift::TypeKind::Metatype:
79567965 case swift::TypeKind::Module:
79577966 case swift::TypeKind::OpaqueTypeArchetype:
@@ -8194,8 +8203,7 @@ SwiftASTContext::GetGenericArgumentKind(opaque_compiler_type_t type,
81948203 size_t idx) {
81958204 VALID_OR_RETURN_CHECK_TYPE (type, eNullGenericKindType);
81968205 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>())
81998207 return eUnboundGenericKindType;
82008208 if (auto *bound_generic_type =
82018209 swift_can_type->getAs <swift::BoundGenericType>())
@@ -8307,8 +8315,6 @@ bool SwiftASTContext::IsMeaninglessWithoutDynamicResolution(
83078315// ----------------------------------------------------------------------
83088316// Dumping types
83098317// ----------------------------------------------------------------------
8310- #define DEPTH_INCREMENT 2
8311-
83128318#ifndef NDEBUG
83138319LLVM_DUMP_METHOD void SwiftASTContext::dump (opaque_compiler_type_t type) const {
83148320 if (!type)
@@ -8348,6 +8354,7 @@ bool SwiftASTContext::DumpTypeValue(
83488354 case swift::TypeKind::Existential:
83498355 case swift::TypeKind::InOut:
83508356 case swift::TypeKind::Integer:
8357+ case swift::TypeKind::Locatable:
83518358 case swift::TypeKind::Module:
83528359 case swift::TypeKind::Pack:
83538360 case swift::TypeKind::PackArchetype:
0 commit comments