Skip to content

Commit 2d81f60

Browse files
committed
[Sema/SILGen] NFC: Remove all mentions of @execution from comments
1 parent 616553d commit 2d81f60

File tree

5 files changed

+39
-38
lines changed

5 files changed

+39
-38
lines changed

lib/SILGen/SILGenExpr.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -489,11 +489,11 @@ namespace {
489489
SGFContext C);
490490

491491
/// Helper method for handling function conversion expr to
492-
/// @execution(caller). Returns an empty RValue on failure.
492+
/// nonisolated(nonsending). Returns an empty RValue on failure.
493493
RValue emitFunctionCvtToExecutionCaller(FunctionConversionExpr *E,
494494
SGFContext C);
495495
/// Helper method for handling function conversion expr to a global actor
496-
/// from an @execution(caller) function.
496+
/// from an nonisolated(nonsending) function.
497497
RValue
498498
emitFunctionCvtFromExecutionCallerToGlobalActor(FunctionConversionExpr *E,
499499
SGFContext C);
@@ -1968,17 +1968,17 @@ RValueEmitter::emitFunctionCvtToExecutionCaller(FunctionConversionExpr *e,
19681968
//
19691969
// Swift 6:
19701970
//
1971-
// (fn_cvt_expr type="@execution(caller) () async -> ()"
1972-
// (fn_cvt_expr type="@execution(caller) @Sendable () async -> ()"
1971+
// (fn_cvt_expr type="nonisolated(nonsending) () async -> ()"
1972+
// (fn_cvt_expr type="nonisolated(nonsending) @Sendable () async -> ()"
19731973
// (declref_expr type="() async -> ()"
19741974
//
19751975
// Swift 5:
19761976
//
1977-
// (fn_cvt_expr type="@execution(caller) () async -> ()"
1977+
// (fn_cvt_expr type="nonisolated(nonsending) () async -> ()"
19781978
// (declref_expr type="() async -> ()"
19791979
//
19801980
// The @Sendable in Swift 6 mode is due to us not representing
1981-
// @execution(caller) or @Sendable in the constraint evaluator.
1981+
// nonisolated(nonsending) or @Sendable in the constraint evaluator.
19821982
//
19831983
// The reason why we need to evaluate this especially is that otherwise we
19841984
// generate multiple
@@ -2038,7 +2038,7 @@ RValue RValueEmitter::emitFunctionCvtFromExecutionCallerToGlobalActor(
20382038
// We are pattern matching a conversion sequence like the following:
20392039
//
20402040
// (fn_cvt_expr implicit type="@GlobalActor @Sendable () async -> ()
2041-
// (fn_cvt_expr implicit type="@execution(caller) @Sendable () async -> ()"
2041+
// (fn_cvt_expr implicit type="nonisolated(nonsending) @Sendable () async -> ()"
20422042
// (declref_expr type="() async -> ()"
20432043
//
20442044
// Where the declref referred to by the declref_expr has execution(caller)
@@ -2047,9 +2047,9 @@ RValue RValueEmitter::emitFunctionCvtFromExecutionCallerToGlobalActor(
20472047
// fix it up later.
20482048
//
20492049
// What we want to emit first a direct reference to the caller as an
2050-
// @execution(caller) function, then we convert it to @execution(caller)
2051-
// @Sendable. Finally, we thunk @execution(caller) to @GlobalActor. The
2052-
// thunking is important so that we can ensure that @execution(caller) runs on
2050+
// nonisolated(nonsending) function, then we convert it to nonisolated(nonsending)
2051+
// @Sendable. Finally, we thunk nonisolated(nonsending) to @GlobalActor. The
2052+
// thunking is important so that we can ensure that nonisolated(nonsending) runs on
20532053
// that specific @GlobalActor.
20542054

20552055
CanAnyFunctionType destType =
@@ -2201,13 +2201,13 @@ RValue RValueEmitter::visitFunctionConversionExpr(FunctionConversionExpr *e,
22012201
}
22022202
}
22032203

2204-
// Check if we are converting a function to an @execution(caller) from a
2205-
// declref that is also @execution(caller). In such a case, this was a case
2204+
// Check if we are converting a function to an nonisolated(nonsending) from a
2205+
// declref that is also nonisolated(nonsending). In such a case, this was a case
22062206
// that was put in by Sema. We do not need a thunk, but just need to recognize
22072207
// this case and elide the conversion. The reason why we need to do this is
2208-
// that otherwise, we put in extra thunks that convert @execution(caller) to
2209-
// @execution(concurrent) back to @execution(caller). This is done b/c we do
2210-
// not represent @execution(caller) in interface types, so the actual decl ref
2208+
// that otherwise, we put in extra thunks that convert nonisolated(nonsending) to
2209+
// @concurrent back to nonisolated(nonsending). This is done b/c we do
2210+
// not represent nonisolated(nonsending) in interface types, so the actual decl ref
22112211
// will be viewed as @async () -> ().
22122212
if (destType->getIsolation().isNonIsolatedCaller()) {
22132213
if (RValue rv = emitFunctionCvtToExecutionCaller(e, C))

lib/Sema/AsyncCallerExecutionMigration.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,21 @@ class ValueDecl;
2929
class AbstractClosureExpr;
3030

3131
/// Warns that the behavior of nonisolated async functions will change under
32-
/// `AsyncCallerExecution` and suggests `@execution(concurrent)` to preserve
33-
/// the current behavior.
32+
/// `AsyncCallerExecution` and suggests `@concurrent` to preserve the current
33+
/// behavior.
3434
void warnAboutNewNonisolatedAsyncExecutionBehavior(
3535
ASTContext &ctx, FunctionTypeRepr *node, FunctionTypeIsolation isolation);
3636

3737
/// Warns that the behavior of nonisolated async functions will change under
38-
/// `AsyncCallerExecution` and suggests `@execution(concurrent)` to preserve
39-
/// the current behavior.
38+
/// `AsyncCallerExecution` and suggests `@concurrent` to preserve the current
39+
/// behavior.
4040
void warnAboutNewNonisolatedAsyncExecutionBehavior(ASTContext &ctx,
4141
ValueDecl *node,
4242
ActorIsolation isolation);
4343

4444
/// Warns that the behavior of nonisolated async functions will change under
45-
/// `AsyncCallerExecution` and suggests `@execution(concurrent)` to preserve
46-
/// the current behavior.
45+
/// `AsyncCallerExecution` and suggests `@concurrent` to preserve the current
46+
/// behavior.
4747
void warnAboutNewNonisolatedAsyncExecutionBehavior(ASTContext &ctx,
4848
AbstractClosureExpr *node,
4949
ActorIsolation isolation);

lib/Sema/CSSimplify.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3303,14 +3303,14 @@ ConstraintSystem::matchFunctionTypes(FunctionType *func1, FunctionType *func2,
33033303
SmallVector<AnyFunctionType::Param, 8> func2Params;
33043304
func2Params.append(func2->getParams().begin(), func2->getParams().end());
33053305

3306-
// Support conversion from `@execution(caller)` to a function type
3306+
// Support conversion from `nonisolated(nonsending)` to a function type
33073307
// with an isolated parameter.
33083308
if (subKind == ConstraintKind::Subtype &&
33093309
func1->getIsolation().isNonIsolatedCaller() &&
33103310
func2->getIsolation().isParameter()) {
3311-
// `@execution(caller)` function gets an implicit isolation parameter
3312-
// introduced during SILGen and thunk is going to forward an isolation
3313-
// from the caller to it.
3311+
// `nonisolated(nonsending)` function gets an implicit isolation parameter
3312+
// introduced during SILGen and thunk is going to forward an isolation from
3313+
// the caller to it.
33143314
// Let's remove the isolated parameter from consideration, function
33153315
// types have to match on everything else.
33163316
llvm::erase_if(func2Params, [](const AnyFunctionType::Param &param) {

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2719,16 +2719,16 @@ namespace {
27192719
return;
27202720

27212721
switch (toIsolation.getKind()) {
2722-
// Converting to `@execution(caller)` function type
2722+
// Converting to `nonisolated(nonsending)` function type
27232723
case FunctionTypeIsolation::Kind::NonIsolatedCaller: {
27242724
switch (fromIsolation.getKind()) {
27252725
case FunctionTypeIsolation::Kind::NonIsolated: {
2726-
// nonisolated -> @execution(caller) doesn't cross
2726+
// nonisolated -> nonisolated(nonsending) doesn't cross
27272727
// an isolation boundary.
27282728
if (!fromFnType->isAsync())
27292729
break;
27302730

2731-
// @execution(concurrent) -> @execution(caller)
2731+
// @concurrent -> nonisolated(nonsending)
27322732
// crosses an isolation boundary.
27332733
LLVM_FALLTHROUGH;
27342734
}
@@ -2751,9 +2751,9 @@ namespace {
27512751
break;
27522752
}
27532753

2754-
// Converting to nonisolated synchronous or @execution(concurrent)
2755-
// asynchronous function type could require crossing an isolation
2756-
// boundary.
2754+
// Converting to nonisolated synchronous or @concurrent
2755+
// asynchronous function type could require crossing an
2756+
// isolation boundary.
27572757
case FunctionTypeIsolation::Kind::NonIsolated: {
27582758
switch (fromIsolation.getKind()) {
27592759
case FunctionTypeIsolation::Kind::Parameter:
@@ -2769,7 +2769,7 @@ namespace {
27692769
}
27702770

27712771
case FunctionTypeIsolation::Kind::NonIsolated: {
2772-
// nonisolated synchronous <-> @execution(concurrent)
2772+
// nonisolated synchronous <-> @concurrent
27732773
if (fromFnType->isAsync() != toFnType->isAsync()) {
27742774
diagnoseNonSendableParametersAndResult(
27752775
toFnType, /*downgradeToWarning=*/true);
@@ -2791,10 +2791,10 @@ namespace {
27912791
break;
27922792

27932793
case FunctionTypeIsolation::Kind::NonIsolated: {
2794-
// Since @execution(concurrent) as an asynchronous
2795-
// function it would mean that without Sendable
2796-
// check it would be possible for non-Sendable state
2797-
// to escape from actor isolation.
2794+
// Since @concurrent as an asynchronous function it
2795+
// would mean that without Sendable check it would
2796+
// be possible for non-Sendable state to escape from
2797+
// actor isolation.
27982798
if (fromFnType->isAsync()) {
27992799
diagnoseNonSendableParametersAndResult(
28002800
toFnType, /*downgradeToWarning=*/true);

lib/Sema/TypeCheckType.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4240,8 +4240,9 @@ NeverNullType TypeResolver::resolveASTFunctionType(
42404240
break;
42414241

42424242
case FunctionTypeIsolation::Kind::NonIsolatedCaller:
4243-
llvm_unreachable("cannot happen because multiple @execution attributes "
4244-
"aren't allowed.");
4243+
llvm_unreachable(
4244+
"cannot happen because multiple execution behavior attributes "
4245+
"aren't allowed.");
42454246
}
42464247
};
42474248

0 commit comments

Comments
 (0)