Merge exported modules with the same public name in generated interface

If a module has the same `public-module-name` as the module being
generated and its import is exported, merge it into the same generated
interface.

Fix various always-imported modules from being printed while here and
update all the tests that checked for them.

Resolves rdar://137887712.
This commit is contained in:
Ben Barham
2025-04-21 11:24:31 -07:00
parent 6735659d39
commit ddddc667c8
35 changed files with 3500 additions and 3640 deletions

View File

@@ -38,11 +38,14 @@ namespace ide {
/// Flags used when traversing a module for printing.
enum class ModuleTraversal : unsigned {
/// Visit modules even if their contents wouldn't be visible to name lookup.
VisitHidden = 0x01,
VisitHidden = 0x01,
/// Visit submodules.
VisitSubmodules = 0x02,
/// Skip the declarations in a Swift overlay module.
SkipOverlay = 0x04,
SkipOverlay = 0x04,
/// Visit exported modules where their public module name matches the current
/// module.
VisitMatchingExported = 0x08,
};
/// Options used to describe the traversal of a module for printing.