Allow one to separately specify the ABI name of a module.

Introduce a new compiler flag `-module-abi-name <name>` that uses the
given name as the ABI name for the module (rather than the module's
name in source code). The ABI name impacts name mangling and metadata.
This commit is contained in:
Doug Gregor
2021-03-11 11:36:10 -08:00
parent 6f4f9f8c0f
commit 2a28fed34d
22 changed files with 111 additions and 7 deletions

View File

@@ -56,7 +56,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 = 602; // noasync apply
const uint16_t SWIFTMODULE_VERSION_MINOR = 603; // module ABI name
/// A standard hash seed used for all string hashes in a serialized module.
///
@@ -790,7 +790,8 @@ namespace options_block {
RESILIENCE_STRATEGY,
ARE_PRIVATE_IMPORTS_ENABLED,
IS_IMPLICIT_DYNAMIC_ENABLED,
IS_ALLOW_MODULE_WITH_COMPILER_ERRORS_ENABLED
IS_ALLOW_MODULE_WITH_COMPILER_ERRORS_ENABLED,
MODULE_ABI_NAME,
};
using SDKPathLayout = BCRecordLayout<
@@ -828,6 +829,11 @@ namespace options_block {
using IsAllowModuleWithCompilerErrorsEnabledLayout = BCRecordLayout<
IS_ALLOW_MODULE_WITH_COMPILER_ERRORS_ENABLED
>;
using ModuleABINameLayout = BCRecordLayout<
MODULE_ABI_NAME,
BCBlob
>;
}
/// The record types within the input block.