mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Bake the _Concurrency -> Swift ABI module name into the compiler.
Using `-module-abi-name` for the `_Concurrency` module breaks older Swift compilers. Instead, hard-code that "Swift" is the ABI name of the "_Concurrency" module in the compiler to dodge the problem.
This commit is contained in:
@@ -1356,6 +1356,22 @@ ImportedModule::removeDuplicates(SmallVectorImpl<ImportedModule> &imports) {
|
||||
imports.erase(last, imports.end());
|
||||
}
|
||||
|
||||
Identifier ModuleDecl::getABIName() const {
|
||||
if (!ModuleABIName.empty())
|
||||
return ModuleABIName;
|
||||
|
||||
// Hard code that the _Concurrency module has Swift as its ABI name.
|
||||
// FIXME: This works around a backward-compatibility issue where
|
||||
// -module-abi-name is not supported on existing Swift compilers. Remove
|
||||
// this hack later and pass -module-abi-name when building the _Concurrency
|
||||
// module.
|
||||
if (getName().str() == SWIFT_CONCURRENCY_NAME) {
|
||||
ModuleABIName = getASTContext().getIdentifier(STDLIB_NAME);
|
||||
return ModuleABIName;
|
||||
}
|
||||
|
||||
return getName();
|
||||
}
|
||||
|
||||
StringRef ModuleDecl::getModuleFilename() const {
|
||||
// FIXME: Audit uses of this function and figure out how to migrate them to
|
||||
|
||||
Reference in New Issue
Block a user