Hack in a -module-link-name option for autolinking.

In Swift, a module is expected to know which libraries it needs, rather than
having this specified by an external module map. While we haven't quite
designed this yet (frameworks get this for free in Clang, for example),
we can at least provide a simple option for the common case of a module
associated with a single library.

This will probably change in the future, so I left in the more general
deserialization code I was working on before simplifying the use case.
A loaded module can in theory specify any arbitrary frameworks or libraries
as dependencies, not just a single dylib.

Swift SVN r7583
This commit is contained in:
Jordan Rose
2013-08-26 18:57:48 +00:00
parent 22912bc3b3
commit ee2ed392c7
7 changed files with 91 additions and 12 deletions

View File

@@ -301,3 +301,12 @@ SerializedModuleLoader::lookupClassMember(const Module *module,
return;
moduleFile->lookupClassMember(accessPath, name, decls);
}
void
SerializedModuleLoader::getLinkLibraries(const Module *module,
Module::LinkLibraryCallback callback) {
ModuleFile *moduleFile = cast<SerializedModule>(module)->File;
if (!moduleFile)
return;
moduleFile->getLinkLibraries(callback);
}