Skip to content

Commit 7618807

Browse files
Merge pull request #10054 from adrian-prantl/warnings
Fix warnings (NFC)
2 parents 225194f + 9b79944 commit 7618807

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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.
46544654
static 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:
@@ -6254,6 +6255,7 @@ lldb::TypeClass SwiftASTContext::GetTypeClass(opaque_compiler_type_t type) {
62546255
case swift::TypeKind::BuiltinPackIndex:
62556256
case swift::TypeKind::BuiltinTuple:
62566257
case swift::TypeKind::BuiltinUnboundGeneric:
6258+
case swift::TypeKind::Locatable:
62576259
case swift::TypeKind::Integer:
62586260
case swift::TypeKind::Pack:
62596261
case swift::TypeKind::PackElement:
@@ -6752,6 +6754,7 @@ lldb::Encoding SwiftASTContext::GetEncoding(opaque_compiler_type_t type,
67526754
case swift::TypeKind::BuiltinRawUnsafeContinuation:
67536755
case swift::TypeKind::Error:
67546756
case swift::TypeKind::InOut:
6757+
case swift::TypeKind::Locatable:
67556758
case swift::TypeKind::Module:
67566759
case swift::TypeKind::BuiltinPackIndex:
67576760
case swift::TypeKind::Pack:
@@ -6877,6 +6880,7 @@ SwiftASTContext::GetNumChildren(opaque_compiler_type_t type,
68776880
case swift::TypeKind::GenericTypeParam:
68786881
case swift::TypeKind::InOut:
68796882
case swift::TypeKind::Integer:
6883+
case swift::TypeKind::Locatable:
68806884
case swift::TypeKind::Metatype:
68816885
case swift::TypeKind::Module:
68826886
case swift::TypeKind::OpaqueTypeArchetype:
@@ -7011,6 +7015,7 @@ uint32_t SwiftASTContext::GetNumFields(opaque_compiler_type_t type,
70117015
case swift::TypeKind::ErrorUnion:
70127016
case swift::TypeKind::InOut:
70137017
case swift::TypeKind::Integer:
7018+
case swift::TypeKind::Locatable:
70147019
case swift::TypeKind::Module:
70157020
case swift::TypeKind::Pack:
70167021
case swift::TypeKind::PackArchetype:
@@ -7242,6 +7247,7 @@ CompilerType SwiftASTContext::GetFieldAtIndex(opaque_compiler_type_t type,
72427247
case swift::TypeKind::ErrorUnion:
72437248
case swift::TypeKind::InOut:
72447249
case swift::TypeKind::Integer:
7250+
case swift::TypeKind::Locatable:
72457251
case swift::TypeKind::Module:
72467252
case swift::TypeKind::Pack:
72477253
case swift::TypeKind::PackArchetype:
@@ -7449,6 +7455,7 @@ uint32_t SwiftASTContext::GetNumPointeeChildren(opaque_compiler_type_t type) {
74497455
case swift::TypeKind::GenericTypeParam:
74507456
case swift::TypeKind::InOut:
74517457
case swift::TypeKind::Integer:
7458+
case swift::TypeKind::Locatable:
74527459
case swift::TypeKind::Metatype:
74537460
case swift::TypeKind::Module:
74547461
case swift::TypeKind::OpaqueTypeArchetype:
@@ -7609,6 +7616,7 @@ llvm::Expected<CompilerType> SwiftASTContext::GetChildCompilerTypeAtIndex(
76097616
case swift::TypeKind::GenericTypeParam:
76107617
case swift::TypeKind::InOut:
76117618
case swift::TypeKind::Integer:
7619+
case swift::TypeKind::Locatable:
76127620
case swift::TypeKind::Metatype:
76137621
case swift::TypeKind::Module:
76147622
case swift::TypeKind::OpaqueTypeArchetype:
@@ -7959,6 +7967,7 @@ size_t SwiftASTContext::GetIndexOfChildMemberWithName(
79597967
case swift::TypeKind::GenericFunction:
79607968
case swift::TypeKind::InOut:
79617969
case swift::TypeKind::Integer:
7970+
case swift::TypeKind::Locatable:
79627971
case swift::TypeKind::Metatype:
79637972
case swift::TypeKind::Module:
79647973
case swift::TypeKind::OpaqueTypeArchetype:
@@ -8201,8 +8210,7 @@ SwiftASTContext::GetGenericArgumentKind(opaque_compiler_type_t type,
82018210
size_t idx) {
82028211
VALID_OR_RETURN_CHECK_TYPE(type, eNullGenericKindType);
82038212
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>())
82068214
return eUnboundGenericKindType;
82078215
if (auto *bound_generic_type =
82088216
swift_can_type->getAs<swift::BoundGenericType>())
@@ -8314,8 +8322,6 @@ bool SwiftASTContext::IsMeaninglessWithoutDynamicResolution(
83148322
//----------------------------------------------------------------------
83158323
// Dumping types
83168324
//----------------------------------------------------------------------
8317-
#define DEPTH_INCREMENT 2
8318-
83198325
#ifndef NDEBUG
83208326
LLVM_DUMP_METHOD void SwiftASTContext::dump(opaque_compiler_type_t type) const {
83218327
if (!type)
@@ -8355,6 +8361,7 @@ bool SwiftASTContext::DumpTypeValue(
83558361
case swift::TypeKind::Existential:
83568362
case swift::TypeKind::InOut:
83578363
case swift::TypeKind::Integer:
8364+
case swift::TypeKind::Locatable:
83588365
case swift::TypeKind::Module:
83598366
case swift::TypeKind::Pack:
83608367
case swift::TypeKind::PackArchetype:

0 commit comments

Comments
 (0)