mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -166,6 +166,9 @@ class ModuleDecl : public DeclContext, public TypeDecl {
|
||||
friend class DirectOperatorLookupRequest;
|
||||
friend class DirectPrecedenceGroupLookupRequest;
|
||||
|
||||
/// The ABI name of the module, if it differs from the module name.
|
||||
Identifier ModuleABIName;
|
||||
|
||||
public:
|
||||
/// Produces the components of a given module's full name in reverse order.
|
||||
///
|
||||
@@ -343,6 +346,17 @@ public:
|
||||
void getDeclaredCrossImportBystanders(
|
||||
SmallVectorImpl<Identifier> &bystanderNames);
|
||||
|
||||
/// Retrieve the ABI name of the module, which is used for metadata and
|
||||
/// mangling.
|
||||
Identifier getABIName() const {
|
||||
return ModuleABIName.empty() ? getName() : ModuleABIName;
|
||||
}
|
||||
|
||||
/// Set the ABI name of the module;
|
||||
void setABIName(Identifier name) {
|
||||
ModuleABIName = name;
|
||||
}
|
||||
|
||||
private:
|
||||
/// A cache of this module's underlying module and required bystander if it's
|
||||
/// an underscored cross-import overlay.
|
||||
|
||||
Reference in New Issue
Block a user