Skip to content

[rebranch][Swift] Update for removal of ModuleDecl from various APIs #8954

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,6 @@ CompilerType SwiftLanguageRuntimeImpl::BindGenericTypeParametersRemoteAST(
if (target_swift_type->hasArchetype())
target_swift_type = target_swift_type->mapTypeOutOfContext().getPointer();

// FIXME: This is wrong, but it doesn't actually matter right now since
// all conformances are always visible
auto *module_decl = swift_ast_ctx->GetASTContext()->getStdlibModule();

// Replace opaque types with their underlying types when possible.
swift::Mangle::ASTMangler mangler(true);

Expand Down Expand Up @@ -406,7 +402,7 @@ CompilerType SwiftLanguageRuntimeImpl::BindGenericTypeParametersRemoteAST(

return result_type;
},
swift::LookUpConformanceInModule(module_decl),
swift::LookUpConformanceInModule(),
swift::SubstFlags::DesugarMemberTypes |
swift::SubstFlags::SubstituteOpaqueArchetypes);

Expand Down Expand Up @@ -434,7 +430,7 @@ CompilerType SwiftLanguageRuntimeImpl::BindGenericTypeParametersRemoteAST(
swift_ast_ctx->GetSwiftType(target_concrete_type))
.value_or(swift::Type());
},
swift::LookUpConformanceInModule(module_decl),
swift::LookUpConformanceInModule(),
swift::SubstFlags::DesugarMemberTypes);
assert(target_swift_type);

Expand Down
7 changes: 3 additions & 4 deletions lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,6 @@ class SwiftAllPayloadEnumDescriptor : public SwiftEnumDescriptor {
LOG_PRINTF(GetLog(LLDBLog::Types), "tag_bits = %s",
Dump(m_tag_bits).c_str());

auto module_ctx = enum_decl->getModuleContext();
const bool has_payload = true;
for (auto enum_case : elements_with_payload) {
ConstString case_name(enum_case.decl->getBaseIdentifier().str());
Expand All @@ -615,7 +614,7 @@ class SwiftAllPayloadEnumDescriptor : public SwiftEnumDescriptor {
CompilerType case_type;
if (arg_type) {
case_type = ToCompilerType(
{swift_can_type->getTypeOfMember(module_ctx, case_decl, arg_type)
{swift_can_type->getTypeOfMember(case_decl, arg_type)
->getCanonicalType()
.getPointer()});
}
Expand Down Expand Up @@ -7313,7 +7312,7 @@ CompilerType SwiftASTContext::GetFieldAtIndex(opaque_compiler_type_t type,
*is_bitfield_ptr = false;

swift::Type child_swift_type = swift_can_type->getTypeOfMember(
nominal->getModuleContext(), property);
property);
return ToCompilerType(child_swift_type.getPointer());
}

Expand Down Expand Up @@ -7727,7 +7726,7 @@ llvm::Expected<CompilerType> SwiftASTContext::GetChildCompilerTypeAtIndex(
// Find the stored property with this index.
auto property = stored_properties[idx];
swift::Type child_swift_type = swift_can_type->getTypeOfMember(
nominal->getModuleContext(), property);
property);

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