mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[cxx-interop] compilations that do not enable C++ interoperability should not be able to import modules that do enable C++ interoperability by default
A supplemental hidden frontend option allows advanced users to opt-out of this requirement. Fixes https://github.com/apple/swift/issues/65833 Fixes https://github.com/apple/swift/issues/65832
This commit is contained in:
@@ -843,6 +843,7 @@ void Serializer::writeBlockInfoBlock() {
|
||||
BLOCK_RECORD(options_block, IS_ALLOW_MODULE_WITH_COMPILER_ERRORS_ENABLED);
|
||||
BLOCK_RECORD(options_block, MODULE_ABI_NAME);
|
||||
BLOCK_RECORD(options_block, IS_CONCURRENCY_CHECKED);
|
||||
BLOCK_RECORD(options_block, HAS_CXX_INTEROPERABILITY_ENABLED);
|
||||
BLOCK_RECORD(options_block, MODULE_PACKAGE_NAME);
|
||||
BLOCK_RECORD(options_block, MODULE_EXPORT_AS_NAME);
|
||||
BLOCK_RECORD(options_block, PLUGIN_SEARCH_PATH);
|
||||
@@ -1090,6 +1091,12 @@ void Serializer::writeHeader(const SerializationOptions &options) {
|
||||
IsConcurrencyChecked.emit(ScratchRecord);
|
||||
}
|
||||
|
||||
if (M->hasCxxInteroperability()) {
|
||||
options_block::HasCxxInteroperabilityEnabledLayout
|
||||
CxxInteroperabilityEnabled(Out);
|
||||
CxxInteroperabilityEnabled.emit(ScratchRecord);
|
||||
}
|
||||
|
||||
if (options.SerializeOptionsForDebugging) {
|
||||
options_block::SDKPathLayout SDKPath(Out);
|
||||
options_block::XCCLayout XCC(Out);
|
||||
|
||||
Reference in New Issue
Block a user