ModuleInterface: Print imports shadowed by a cross-import overlay

In some cases this import may be superfluous as it's also
`@_exported` imported by the overlay. However, when the overlay
is hidden and the import not printed, the import can go entierly
missing.
This commit is contained in:
Alexis Laferrière
2024-06-11 16:32:45 -07:00
parent 7c69bec9b4
commit f53be71874
3 changed files with 74 additions and 3 deletions

View File

@@ -240,7 +240,8 @@ static void printImports(raw_ostream &out,
// it's not obvious what higher-level optimization would be factored out here.
ModuleDecl::ImportFilter allImportFilter = {
ModuleDecl::ImportFilterKind::Exported,
ModuleDecl::ImportFilterKind::Default};
ModuleDecl::ImportFilterKind::Default,
ModuleDecl::ImportFilterKind::ShadowedByCrossImportOverlay};
// With -experimental-spi-imports:
// When printing the private or package swiftinterface file, print implementation-only