Skip to content

Commit 9c9fef1

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. (cherry picked from commit de8c8f5)
1 parent 45699ce commit 9c9fef1

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
@@ -1427,9 +1427,19 @@ bool ModuleDecl::isStdlibModule() const {
14271427
}
14281428

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

14351445
bool ModuleDecl::isSwiftShimsModule() const {

0 commit comments

Comments
 (0)