[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:
Alex Lorenz
2023-06-07 15:06:06 -07:00
parent 4d1d8a9de5
commit ba8d4d7801
18 changed files with 104 additions and 7 deletions

View File

@@ -58,7 +58,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0;
/// describe what change you made. The content of this comment isn't important;
/// it just ensures a conflict if two people change the module format.
/// Don't worry about adhering to the 80-column limit for this line.
const uint16_t SWIFTMODULE_VERSION_MINOR = 790; // add `out` kind to mark uninitialized instruction
const uint16_t SWIFTMODULE_VERSION_MINOR = 791; // HasCxxInteroperability
/// A standard hash seed used for all string hashes in a serialized module.
///
@@ -888,6 +888,7 @@ namespace options_block {
EXTERNAL_SEARCH_PLUGIN_PATH,
COMPILER_PLUGIN_LIBRARY_PATH,
COMPILER_PLUGIN_EXECUTABLE_PATH,
HAS_CXX_INTEROPERABILITY_ENABLED,
};
using SDKPathLayout = BCRecordLayout<
@@ -976,6 +977,10 @@ namespace options_block {
MODULE_EXPORT_AS_NAME,
BCBlob
>;
using HasCxxInteroperabilityEnabledLayout = BCRecordLayout<
HAS_CXX_INTEROPERABILITY_ENABLED
>;
}
/// The record types within the input block.