mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user