mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Serialization: serialize if the module is a static library
If the `-static` option is specified, store that in the generated swiftmodule file. When de-serializing, recover this information in the representative SILModule. This will be used for code generation on Windows. It is the missing piece to allow static linking to function properly. It additionally opens the path to additional optimization on ELF-ish targets - GOT, PLT references can be avoided when the linked module is known to be static. Co-authored by: Saleem Abdulrasool <compnerd@compnerd.org>
This commit is contained in:
committed by
Saleem Abdulrasool
parent
fba9d8342f
commit
762e9c7882
@@ -715,6 +715,7 @@ LoadedFile *SerializedModuleLoaderBase::loadAST(
|
||||
|
||||
// We've loaded the file. Now try to bring it into the AST.
|
||||
fileUnit = new (Ctx) SerializedASTFile(M, *loadedModuleFile);
|
||||
M.setStaticLibrary(loadedModuleFile->isStaticLibrary());
|
||||
if (loadedModuleFile->isTestable())
|
||||
M.setTestingEnabled();
|
||||
if (loadedModuleFile->arePrivateImportsEnabled())
|
||||
|
||||
Reference in New Issue
Block a user