@@ -1400,8 +1400,8 @@ static bool isCreateExecutorsFunctionAvailable(SILGenModule &SGM) {
1400
1400
if (!ctx.LangOpts .DisableAvailabilityChecking ) {
1401
1401
auto deploymentAvailability = AvailabilityRange::forDeploymentTarget (ctx);
1402
1402
auto runtimeAvailability = AvailabilityRange::forRuntimeTarget (ctx);
1403
- auto declAvailability = ctx.getCustomExecutorsAvailability ();
1404
- auto declRtAvailability = ctx.getCustomExecutorsRuntimeAvailability ();
1403
+ auto declAvailability = ctx.getCustomGlobalExecutorsAvailability ();
1404
+ auto declRtAvailability = ctx.getCustomGlobalExecutorsRuntimeAvailability ();
1405
1405
return deploymentAvailability.isContainedIn (declAvailability)
1406
1406
&& runtimeAvailability.isContainedIn (declRtAvailability);
1407
1407
}
@@ -1429,21 +1429,23 @@ void SILGenFunction::emitAsyncMainThreadStart(SILDeclRef entryPoint) {
1429
1429
if (!isCreateExecutorsFunctionAvailable (SGM)) {
1430
1430
ctx.Diags .diagnose (SourceLoc (), diag::executor_factory_not_supported);
1431
1431
} else {
1432
- CanType factoryTy = SGM.getExecutorFactory ()->getCanonicalType ();
1432
+ CanType factoryTy = SGM.getConfiguredExecutorFactory ()->getCanonicalType ();
1433
1433
1434
1434
if (!factoryTy) {
1435
1435
ctx.Diags .diagnose (SourceLoc (), diag::cannot_find_executor_factory_type,
1436
1436
*ctx.LangOpts .ExecutorFactory );
1437
1437
}
1438
1438
1439
- ProtocolDecl *executorFactoryProtocol = SGM.getExecutorFactoryProtocol ();
1439
+ ProtocolDecl *executorFactoryProtocol
1440
+ = ctx.getProtocol (KnownProtocolKind::ExecutorFactory);
1440
1441
auto conformance = lookupConformance (factoryTy, executorFactoryProtocol);
1441
1442
1442
1443
if (conformance.isInvalid ()) {
1443
1444
// If this type doesn't conform, ignore it and use the default factory
1444
1445
SourceLoc loc = extractNearestSourceLoc (factoryTy);
1445
1446
1446
- ctx.Diags .diagnose (loc, diag::executor_factory_must_conform, factoryTy);
1447
+ ctx.Diags .diagnose (loc, diag::executor_factory_must_conform,
1448
+ *ctx.LangOpts .ExecutorFactory );
1447
1449
1448
1450
factoryTy = SGM.getDefaultExecutorFactory ()->getCanonicalType ();
1449
1451
conformance = lookupConformance (factoryTy, executorFactoryProtocol);
@@ -1464,7 +1466,7 @@ void SILGenFunction::emitAsyncMainThreadStart(SILDeclRef entryPoint) {
1464
1466
SILValue factorySILMetaTy
1465
1467
= B.createMetatype (moduleLoc, getLoweredType (factoryThickMetaTy));
1466
1468
auto ceSubs = SubstitutionMap::getProtocolSubstitutions (
1467
- conformance.getRequirement (), factoryTy, conformance);
1469
+ conformance.getProtocol (), factoryTy, conformance);
1468
1470
B.createApply (moduleLoc, createExecutorsFunc, ceSubs, { factorySILMetaTy });
1469
1471
}
1470
1472
}
0 commit comments