Skip to content

Commit de8c8f5

Browse files
committed
Disable standard substitutions when building with "older" _Concurrency module
To smooth over an ABI transition, disable the standard substitutions for the _Concurrency module within the AST mangler when the _Concurrency module we are using predates custom executors. This is a short-term hack that should be removed when we settle the ABI. Addresses rdar://79298287.
1 parent 0b1999f commit de8c8f5

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

lib/AST/Module.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,9 +1428,19 @@ bool ModuleDecl::isStdlibModule() const {
14281428
}
14291429

14301430
bool ModuleDecl::hasStandardSubstitutions() const {
1431-
return !getParent() &&
1432-
(getName() == getASTContext().StdlibModuleName ||
1433-
getName() == getASTContext().Id_Concurrency);
1431+
if (getParent())
1432+
return false;
1433+
1434+
if (getName() == getASTContext().StdlibModuleName)
1435+
return true;
1436+
1437+
// The _Concurrency module gets standard substitutions with "new enough"
1438+
// versions of the module.
1439+
if (getName() == getASTContext().Id_Concurrency &&
1440+
getASTContext().getProtocol(KnownProtocolKind::SerialExecutor))
1441+
return true;
1442+
1443+
return false;
14341444
}
14351445

14361446
bool ModuleDecl::isSwiftShimsModule() const {

0 commit comments

Comments
 (0)