Skip to content

Commit 5ed3fc3

Browse files
authored
Merge pull request #8950 from slavapestov/global-conformance-lookup
[Swift] Update for removal of ModuleDecl from various APIs
2 parents 76ba61e + bf29351 commit 5ed3fc3

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntimeRemoteAST.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,6 @@ CompilerType SwiftLanguageRuntimeImpl::BindGenericTypeParametersRemoteAST(
307307
if (target_swift_type->hasArchetype())
308308
target_swift_type = target_swift_type->mapTypeOutOfContext().getPointer();
309309

310-
// FIXME: This is wrong, but it doesn't actually matter right now since
311-
// all conformances are always visible
312-
auto *module_decl = swift_ast_ctx->GetASTContext()->getStdlibModule();
313-
314310
// Replace opaque types with their underlying types when possible.
315311
swift::Mangle::ASTMangler mangler(true);
316312

@@ -406,7 +402,7 @@ CompilerType SwiftLanguageRuntimeImpl::BindGenericTypeParametersRemoteAST(
406402

407403
return result_type;
408404
},
409-
swift::LookUpConformanceInModule(module_decl),
405+
swift::LookUpConformanceInModule(),
410406
swift::SubstFlags::DesugarMemberTypes |
411407
swift::SubstFlags::SubstituteOpaqueArchetypes);
412408

@@ -434,7 +430,7 @@ CompilerType SwiftLanguageRuntimeImpl::BindGenericTypeParametersRemoteAST(
434430
swift_ast_ctx->GetSwiftType(target_concrete_type))
435431
.value_or(swift::Type());
436432
},
437-
swift::LookUpConformanceInModule(module_decl),
433+
swift::LookUpConformanceInModule(),
438434
swift::SubstFlags::DesugarMemberTypes);
439435
assert(target_swift_type);
440436

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,6 @@ class SwiftAllPayloadEnumDescriptor : public SwiftEnumDescriptor {
602602
LOG_PRINTF(GetLog(LLDBLog::Types), "tag_bits = %s",
603603
Dump(m_tag_bits).c_str());
604604

605-
auto module_ctx = enum_decl->getModuleContext();
606605
const bool has_payload = true;
607606
for (auto enum_case : elements_with_payload) {
608607
ConstString case_name(enum_case.decl->getBaseIdentifier().str());
@@ -613,7 +612,7 @@ class SwiftAllPayloadEnumDescriptor : public SwiftEnumDescriptor {
613612
CompilerType case_type;
614613
if (arg_type) {
615614
case_type = ToCompilerType(
616-
{swift_can_type->getTypeOfMember(module_ctx, case_decl, arg_type)
615+
{swift_can_type->getTypeOfMember(case_decl, arg_type)
617616
->getCanonicalType()
618617
.getPointer()});
619618
}
@@ -7314,7 +7313,7 @@ CompilerType SwiftASTContext::GetFieldAtIndex(opaque_compiler_type_t type,
73147313
*is_bitfield_ptr = false;
73157314

73167315
swift::Type child_swift_type = swift_can_type->getTypeOfMember(
7317-
nominal->getModuleContext(), property);
7316+
property);
73187317
return ToCompilerType(child_swift_type.getPointer());
73197318
}
73207319

@@ -7728,7 +7727,7 @@ llvm::Expected<CompilerType> SwiftASTContext::GetChildCompilerTypeAtIndex(
77287727
// Find the stored property with this index.
77297728
auto property = stored_properties[idx];
77307729
swift::Type child_swift_type = swift_can_type->getTypeOfMember(
7731-
nominal->getModuleContext(), property);
7730+
property);
77327731

77337732
CompilerType child_type = ToCompilerType(child_swift_type.getPointer());
77347733
child_name = property->getBaseName().userFacingName().str();

0 commit comments

Comments
 (0)