Fix IRGenModule::getMaximalTypeExpansionContext to use the proper associated context

In a per file compilation mode we want to use the file context -- which is
stored in the AssociatedContext -- rather than defaulting to the current Swift
Module context.

rdar://114344533
This commit is contained in:
Arnold Schwaighofer
2023-09-05 11:59:04 -07:00
parent f177be06ab
commit 1b8e20ee09
3 changed files with 27 additions and 1 deletions

View File

@@ -2017,7 +2017,7 @@ const llvm::StringRef IRGenerator::getClangDataLayoutString() {
}
TypeExpansionContext IRGenModule::getMaximalTypeExpansionContext() const {
return TypeExpansionContext::maximal(getSwiftModule(),
return TypeExpansionContext::maximal(getSILModule().getAssociatedContext(),
getSILModule().isWholeModule());
}