mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fix unnecessary one-time recompile of stdlib with -enable-ossa-flag (#39516)
* Fix unnecessary one-time recompile of stdlib with -enable-ossa-flag This includes a bit in the module format to represent if the module was compiled with -enable-ossa-modules flag. When compiling a client module with -enable-ossa-modules flag, all dependent modules are checked for this bit, if not on, recompilation is triggered with -enable-ossa-modules. * Updated tests
This commit is contained in:
@@ -805,6 +805,7 @@ void Serializer::writeBlockInfoBlock() {
|
||||
BLOCK_RECORD(control_block, TARGET);
|
||||
BLOCK_RECORD(control_block, SDK_NAME);
|
||||
BLOCK_RECORD(control_block, REVISION);
|
||||
BLOCK_RECORD(control_block, IS_OSSA);
|
||||
|
||||
BLOCK(OPTIONS_BLOCK);
|
||||
BLOCK_RECORD(options_block, SDK_PATH);
|
||||
@@ -957,6 +958,7 @@ void Serializer::writeHeader(const SerializationOptions &options) {
|
||||
control_block::TargetLayout Target(Out);
|
||||
control_block::SDKNameLayout SDKName(Out);
|
||||
control_block::RevisionLayout Revision(Out);
|
||||
control_block::IsOSSALayout IsOSSA(Out);
|
||||
|
||||
ModuleName.emit(ScratchRecord, M->getName().str());
|
||||
|
||||
@@ -1007,6 +1009,8 @@ void Serializer::writeHeader(const SerializationOptions &options) {
|
||||
Revision.emit(ScratchRecord, revision);
|
||||
}
|
||||
|
||||
IsOSSA.emit(ScratchRecord, options.IsOSSA);
|
||||
|
||||
{
|
||||
llvm::BCBlockRAII restoreBlock(Out, OPTIONS_BLOCK_ID, 4);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user