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:
Erik Eckstein
2021-04-30 14:04:39 +02:00
committed by Saleem Abdulrasool
parent fba9d8342f
commit 762e9c7882
14 changed files with 50 additions and 2 deletions

View File

@@ -326,6 +326,9 @@ private:
/// Whether this module file is actually a .sib file.
unsigned IsSIB: 1;
/// Whether this module is compiled as static library.
unsigned IsStaticLibrary: 1;
/// Whether this module file is compiled with '-enable-testing'.
unsigned IsTestable : 1;