Enforce consistent usage of -experimental-hermetic-seat-at-link flag (#39986)

We've recently added the -experimental-hermetic-seal-at-link compiler flag,
which turns on aggressive dead-stripping optimizations and assumes that library
code can be optimized against client code because all users of the library
code/types are present at link/LTO time. This means that any module that's
built with -experimental-hermetic-seal-at-link requires all clients of this
module to also use -experimental-hermetic-seal-at-link. This PR enforces that
by storing a bit in the serialized module, and checking the bit when importing
modules.
This commit is contained in:
Kuba (Brecka) Mracek
2021-11-30 10:44:58 -08:00
committed by GitHub
parent 775c632d03
commit c89eca6c34
18 changed files with 91 additions and 5 deletions

View File

@@ -488,6 +488,7 @@ ModuleDecl::ModuleDecl(Identifier name, ASTContext &ctx,
Bits.ModuleDecl.IsNonSwiftModule = 0;
Bits.ModuleDecl.IsMainModule = 0;
Bits.ModuleDecl.HasIncrementalInfo = 0;
Bits.ModuleDecl.HasHermeticSealAtLink = 0;
Bits.ModuleDecl.IsConcurrencyChecked = 0;
}