mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
During Package CMO, SIL cloning happens during which
SILOptions::EnableSerializePackage info is lost. SILVerifier needs this info to determine whether resilience can be bypassed for decls serialized in a resiliently built module when Package CMO optimization enabled. This PR adds SerializePackageEnabled bit to Module format and uses that in SILVerifier. Resolves rdar://126157356
This commit is contained in:
@@ -855,6 +855,7 @@ void Serializer::writeBlockInfoBlock() {
|
||||
BLOCK_RECORD(options_block, MODULE_EXPORT_AS_NAME);
|
||||
BLOCK_RECORD(options_block, PLUGIN_SEARCH_OPTION);
|
||||
BLOCK_RECORD(options_block, ALLOW_NON_RESILIENT_ACCESS);
|
||||
BLOCK_RECORD(options_block, SERIALIZE_PACKAGE_ENABLED);
|
||||
|
||||
BLOCK(INPUT_BLOCK);
|
||||
BLOCK_RECORD(input_block, IMPORTED_MODULE);
|
||||
@@ -1092,6 +1093,11 @@ void Serializer::writeHeader() {
|
||||
AllowNonResAcess.emit(ScratchRecord);
|
||||
}
|
||||
|
||||
if (M->serializePackageEnabled()) {
|
||||
options_block::SerializePackageEnabled SerializePkgEnabled(Out);
|
||||
SerializePkgEnabled.emit(ScratchRecord);
|
||||
}
|
||||
|
||||
if (allowCompilerErrors()) {
|
||||
options_block::IsAllowModuleWithCompilerErrorsEnabledLayout
|
||||
AllowErrors(Out);
|
||||
|
||||
Reference in New Issue
Block a user