Skip to content

Commit 61741c0

Browse files
committed
[Sema/SILGen] NFC: Remove all mentions of @execution from comments
1 parent b9df4c8 commit 61741c0

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
@@ -2712,16 +2712,16 @@ namespace {
27122712
return;
27132713

27142714
switch (toIsolation.getKind()) {
2715-
// Converting to `@execution(caller)` function type
2715+
// Converting to `nonisolated(nonsending)` function type
27162716
case FunctionTypeIsolation::Kind::NonIsolatedCaller: {
27172717
switch (fromIsolation.getKind()) {
27182718
case FunctionTypeIsolation::Kind::NonIsolated: {
2719-
// nonisolated -> @execution(caller) doesn't cross
2719+
// nonisolated -> nonisolated(nonsending) doesn't cross
27202720
// an isolation boundary.
27212721
if (!fromFnType->isAsync())
27222722
break;
27232723

2724-
// @execution(concurrent) -> @execution(caller)
2724+
// @concurrent -> nonisolated(nonsending)
27252725
// crosses an isolation boundary.
27262726
LLVM_FALLTHROUGH;
27272727
}
@@ -2744,9 +2744,9 @@ namespace {
27442744
break;
27452745
}
27462746

2747-
// Converting to nonisolated synchronous or @execution(concurrent)
2748-
// asynchronous function type could require crossing an isolation
2749-
// boundary.
2747+
// Converting to nonisolated synchronous or @concurrent
2748+
// asynchronous function type could require crossing an
2749+
// isolation boundary.
27502750
case FunctionTypeIsolation::Kind::NonIsolated: {
27512751
switch (fromIsolation.getKind()) {
27522752
case FunctionTypeIsolation::Kind::Parameter:
@@ -2762,7 +2762,7 @@ namespace {
27622762
}
27632763

27642764
case FunctionTypeIsolation::Kind::NonIsolated: {
2765-
// nonisolated synchronous <-> @execution(concurrent)
2765+
// nonisolated synchronous <-> @concurrent
27662766
if (fromFnType->isAsync() != toFnType->isAsync()) {
27672767
diagnoseNonSendableParametersAndResult(
27682768
toFnType, /*downgradeToWarning=*/true);
@@ -2784,10 +2784,10 @@ namespace {
27842784
break;
27852785

27862786
case FunctionTypeIsolation::Kind::NonIsolated: {
2787-
// Since @execution(concurrent) as an asynchronous
2788-
// function it would mean that without Sendable
2789-
// check it would be possible for non-Sendable state
2790-
// to escape from actor isolation.
2787+
// Since @concurrent as an asynchronous function it
2788+
// would mean that without Sendable check it would
2789+
// be possible for non-Sendable state to escape from
2790+
// actor isolation.
27912791
if (fromFnType->isAsync()) {
27922792
diagnoseNonSendableParametersAndResult(
27932793
toFnType, /*downgradeToWarning=*/true);

lib/Sema/TypeCheckType.cpp

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

42364236
case FunctionTypeIsolation::Kind::NonIsolatedCaller:
4237-
llvm_unreachable("cannot happen because multiple @execution attributes "
4238-
"aren't allowed.");
4237+
llvm_unreachable(
4238+
"cannot happen because multiple execution behavior attributes "
4239+
"aren't allowed.");
42394240
}
42404241
};
42414242

0 commit comments

Comments
 (0)