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:
Meghana Gupta
2021-10-04 18:46:40 -07:00
committed by GitHub
parent b3416247f5
commit f458d9b490
36 changed files with 213 additions and 173 deletions

View File

@@ -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);