Just autolink every imported module, public or private

This is unfortunate in that it makes the linker do extra work, but in
practice it probably doesn't matter much, and meanwhile it handles all
our problems with @inlinable.

Alternate solution to rdar://problem/39338239
This commit is contained in:
Jordan Rose
2018-05-03 11:20:29 -07:00
parent 0e5100da2e
commit 098b170d02
9 changed files with 60 additions and 7 deletions

View File

@@ -1214,13 +1214,15 @@ void ModuleDecl::collectLinkLibraries(LinkLibraryCallback callback) {
void
SourceFile::collectLinkLibraries(ModuleDecl::LinkLibraryCallback callback) const {
const_cast<SourceFile *>(this)->forAllVisibleModules([&](swift::ModuleDecl::ImportedModule import) {
forAllImportedModules<false>(getParentModule(), /*thisPath*/{},
/*includePrivateTopLevelImports*/false,
[=](ModuleDecl::ImportedModule import) -> bool {
swift::ModuleDecl *next = import.second;
if (next->getName() == getParentModule()->getName())
return;
return true;
next->collectLinkLibraries(callback);
return true;
});
}