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

@@ -387,8 +387,11 @@ static bool getModuleInterfaceInfo(
Options.SkipInlineCXXNamespace = true;
}
}
// Skip submodules but include any exported modules that have the same public
// module name as this module.
ModuleTraversalOptions TraversalOptions =
std::nullopt; // Don't print submodules.
ModuleTraversal::VisitMatchingExported;
SmallString<128> Text;
llvm::raw_svector_ostream OS(Text);
AnnotatingPrinter Printer(Info, OS);