Skip to content

Commit e2ff330

Browse files
committed
[Frontend] NFC: Rename NonIsolatedAsyncInheritsIsolationFromContext feature
New name is `AsyncCallerExecution` as stated by the proposal.
1 parent 71f994d commit e2ff330

14 files changed

+30
-38
lines changed

include/swift/Basic/Features.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ SUPPRESSIBLE_EXPERIMENTAL_FEATURE(ABIAttribute, true)
438438

439439
/// Functions with nonisolated isolation inherit their isolation from the
440440
/// calling context.
441-
EXPERIMENTAL_FEATURE(NonIsolatedAsyncInheritsIsolationFromContext, false)
441+
EXPERIMENTAL_FEATURE(AsyncCallerExecution, false)
442442

443443
/// Allow custom availability domains to be defined and referenced.
444444
SUPPRESSIBLE_EXPERIMENTAL_FEATURE(CustomAvailability, true)

lib/AST/FeatureSet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ UNINTERESTING_FEATURE(Volatile)
121121
UNINTERESTING_FEATURE(SuppressedAssociatedTypes)
122122
UNINTERESTING_FEATURE(StructLetDestructuring)
123123
UNINTERESTING_FEATURE(MacrosOnImports)
124-
UNINTERESTING_FEATURE(NonIsolatedAsyncInheritsIsolationFromContext)
124+
UNINTERESTING_FEATURE(AsyncCallerExecution)
125125

126126
static bool usesFeatureNonescapableTypes(Decl *decl) {
127127
auto containsNonEscapable =

lib/SIL/IR/SILFunctionType.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,8 +1658,7 @@ class DestructureInputs {
16581658
}
16591659

16601660
// If we are an async function that is unspecified or nonisolated, insert an
1661-
// isolated parameter if NonIsolatedAsyncInheritsIsolationFromContext is
1662-
// enabled.
1661+
// isolated parameter if AsyncCallerExecution is enabled.
16631662
if (IsolationInfo &&
16641663
IsolationInfo->getKind() == ActorIsolation::CallerIsolationInheriting &&
16651664
extInfoBuilder.isAsync()) {

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4759,9 +4759,8 @@ getIsolationFromAttributes(const Decl *decl, bool shouldDiagnose = true,
47594759
// NOTE: This needs to occur before we handle an explicit nonisolated attr,
47604760
// since if @execution and nonisolated are used together, we want to ensure
47614761
// that @execution takes priority. This ensures that if we import code from a
4762-
// module that was compiled with a different value for
4763-
// NonIsolatedAsyncInheritsIsolationFromContext, we get the semantics of the
4764-
// source module.
4762+
// module that was compiled with a different value for AsyncCallerExecution,
4763+
// we get the semantics of the source module.
47654764
if (concurrentExecutionAttr) {
47664765
switch (concurrentExecutionAttr->getBehavior()) {
47674766
case ExecutionKind::Concurrent:
@@ -4777,7 +4776,7 @@ getIsolationFromAttributes(const Decl *decl, bool shouldDiagnose = true,
47774776
// If the nonisolated async inherits isolation from context is set, return
47784777
// caller isolation inheriting.
47794778
if (decl->getASTContext().LangOpts.hasFeature(
4780-
Feature::NonIsolatedAsyncInheritsIsolationFromContext)) {
4779+
Feature::AsyncCallerExecution)) {
47814780
if (auto *func = dyn_cast<AbstractFunctionDecl>(decl);
47824781
func && func->hasAsync() &&
47834782
func->getModuleContext() == decl->getASTContext().MainModule) {
@@ -5612,8 +5611,7 @@ computeDefaultInferredActorIsolation(ValueDecl *value) {
56125611
}
56135612

56145613
// If we have an async function... by default we inherit isolation.
5615-
if (ctx.LangOpts.hasFeature(
5616-
Feature::NonIsolatedAsyncInheritsIsolationFromContext)) {
5614+
if (ctx.LangOpts.hasFeature(Feature::AsyncCallerExecution)) {
56175615
if (auto *func = dyn_cast<AbstractFunctionDecl>(value);
56185616
func && func->hasAsync() &&
56195617
func->getModuleContext() == ctx.MainModule) {
@@ -5702,8 +5700,8 @@ InferredActorIsolation ActorIsolationRequest::evaluate(
57025700
// did not have an ExecutionKind::Caller attached to it.
57035701
//
57045702
// DISCUSSION: This occurs when we have a value decl that is explicitly marked
5705-
// as nonisolated but since NonIsolatedAsyncInheritsIsolationFromContext is
5706-
// enabled, we return CallerIsolationInheriting.
5703+
// as nonisolated but since AsyncCallerExecution is enabled, we return
5704+
// CallerIsolationInheriting.
57075705
if (isolationFromAttr && isolationFromAttr->getKind() ==
57085706
ActorIsolation::CallerIsolationInheriting &&
57095707
!value->getAttrs().hasAttribute<ExecutionAttr>()) {
@@ -6001,7 +5999,7 @@ InferredActorIsolation ActorIsolationRequest::evaluate(
60015999

60026000
if (auto *func = dyn_cast<AbstractFunctionDecl>(value);
60036001
ctx.LangOpts.hasFeature(
6004-
Feature::NonIsolatedAsyncInheritsIsolationFromContext) &&
6002+
Feature::AsyncCallerExecution) &&
60056003
func && func->hasAsync() &&
60066004
func->getModuleContext() == ctx.MainModule &&
60076005
isolation.isNonisolated()) {

test/ASTGen/attrs.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// RUN: -enable-experimental-feature ABIAttribute \
55
// RUN: -enable-experimental-feature Extern \
66
// RUN: -enable-experimental-feature LifetimeDependence \
7-
// RUN: -enable-experimental-feature NonIsolatedAsyncInheritsIsolationFromContext \
87
// RUN: -enable-experimental-feature SymbolLinkageMarkers \
98
// RUN: -enable-experimental-move-only \
109
// RUN: -enable-experimental-feature ParserASTGen \
@@ -14,7 +13,6 @@
1413
// RUN: -enable-experimental-feature ABIAttribute \
1514
// RUN: -enable-experimental-feature Extern \
1615
// RUN: -enable-experimental-feature LifetimeDependence \
17-
// RUN: -enable-experimental-feature NonIsolatedAsyncInheritsIsolationFromContext \
1816
// RUN: -enable-experimental-feature SymbolLinkageMarkers \
1917
// RUN: -enable-experimental-move-only \
2018
// RUN: | %sanitize-address > %t/cpp-parser.ast
@@ -27,7 +25,6 @@
2725
// RUN: -enable-experimental-feature ABIAttribute \
2826
// RUN: -enable-experimental-feature Extern \
2927
// RUN: -enable-experimental-feature LifetimeDependence \
30-
// RUN: -enable-experimental-feature NonIsolatedAsyncInheritsIsolationFromContext \
3128
// RUN: -enable-experimental-feature SymbolLinkageMarkers \
3229
// RUN: -enable-experimental-move-only
3330

@@ -37,7 +34,6 @@
3734
// REQUIRES: swift_feature_ABIAttribute
3835
// REQUIRES: swift_feature_Extern
3936
// REQUIRES: swift_feature_LifetimeDependence
40-
// REQUIRES: swift_feature_NonIsolatedAsyncInheritsIsolationFromContext
4137
// REQUIRES: swift_feature_SymbolLinkageMarkers
4238

4339
// rdar://116686158

test/Concurrency/Runtime/nonisolated_inherits_isolation.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
// RUN: %target-run-simple-swift( -swift-version 6 -g %import-libdispatch -import-objc-header %S/Inputs/RunOnMainActor.h -enable-experimental-feature NonIsolatedAsyncInheritsIsolationFromContext )
1+
// RUN: %target-run-simple-swift( -swift-version 6 -g %import-libdispatch -import-objc-header %S/Inputs/RunOnMainActor.h -enable-experimental-feature AsyncCallerExecution )
22

33
// REQUIRES: executable_test
44
// REQUIRES: concurrency
55
// REQUIRES: concurrency_runtime
66
// REQUIRES: libdispatch
77
// REQUIRES: asserts
88

9-
// REQUIRES: swift_feature_NonIsolatedAsyncInheritsIsolationFromContext
9+
// REQUIRES: swift_feature_AsyncCallerExecution
1010

1111
// UNSUPPORTED: freestanding
1212

test/Concurrency/attr_execution.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// RUN: %target-swift-emit-silgen -enable-experimental-feature NonIsolatedAsyncInheritsIsolationFromContext %s | %FileCheck %s
1+
// RUN: %target-swift-emit-silgen -enable-experimental-feature AsyncCallerExecution %s | %FileCheck %s
22

33
// REQUIRES: asserts
4-
// REQUIRES: swift_feature_NonIsolatedAsyncInheritsIsolationFromContext
4+
// REQUIRES: swift_feature_AsyncCallerExecution
55

66

77
// CHECK-LABEL: // concurrentTest()

test/Concurrency/nonisolated_inherits_isolation.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
// RUN: %target-swift-frontend %s -swift-version 6 -verify -verify-additional-prefix disabled- -c
2-
// RUN: %target-swift-frontend %s -swift-version 6 -verify -enable-experimental-feature NonIsolatedAsyncInheritsIsolationFromContext -verify-additional-prefix enable- -c -verify-additional-prefix enabled-
2+
// RUN: %target-swift-frontend %s -swift-version 6 -verify -enable-experimental-feature AsyncCallerExecution -verify-additional-prefix enable- -c -verify-additional-prefix enabled-
33

44
// REQUIRES: asserts
55
// REQUIRES: concurrency
6-
// REQUIRES: swift_feature_NonIsolatedAsyncInheritsIsolationFromContext
6+
// REQUIRES: swift_feature_AsyncCallerExecution
77

8-
// This test checks and validates that when
9-
// NonIsolatedAsyncInheritsIsolationFromContext is enabled, we emit the
8+
// This test checks and validates that when AsyncCallerExecution is enabled, we emit the
109
// appropriate diagnostics. It also runs with the mode off so we can validate
1110
// and compare locally against the normal errors.
1211

test/Concurrency/nonisolated_inherits_isolation_sema.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
// RUN: %target-typecheck-verify-swift -swift-version 6 -enable-experimental-feature NonIsolatedAsyncInheritsIsolationFromContext -parse-as-library
1+
// RUN: %target-typecheck-verify-swift -swift-version 6 -enable-experimental-feature AsyncCallerExecution -parse-as-library
22

33
// REQUIRES: asserts
44
// REQUIRES: concurrency
5-
// REQUIRES: swift_feature_NonIsolatedAsyncInheritsIsolationFromContext
5+
// REQUIRES: swift_feature_AsyncCallerExecution
66

77
class NonSendable {} // expected-note {{}}
88

test/ModuleInterface/attrs.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s -module-name attrs \
22
// RUN: -enable-experimental-feature ABIAttribute \
3-
// RUN: -enable-experimental-feature NonIsolatedAsyncInheritsIsolationFromContext
3+
// RUN: -enable-experimental-feature AsyncCallerExecution
44

55
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface) -module-name attrs
66

77
// RUN: %FileCheck %s --input-file %t.swiftinterface
88

99
// REQUIRES: swift_feature_ABIAttribute
10-
// REQUIRES: swift_feature_NonIsolatedAsyncInheritsIsolationFromContext
10+
// REQUIRES: swift_feature_AsyncCallerExecution
1111

1212
// CHECK: @_transparent public func glass() -> Swift.Int { return 0 }{{$}}
1313
@_transparent public func glass() -> Int { return 0 }

test/SILGen/execution_attr.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// RUN: %target-swift-emit-silgen %s | %FileCheck %s
2-
// RUN: %target-swift-emit-silgen %s -enable-experimental-feature NonIsolatedAsyncInheritsIsolationFromContext | %FileCheck %s
2+
// RUN: %target-swift-emit-silgen %s -enable-experimental-feature AsyncCallerExecution | %FileCheck %s
33

44
// REQUIRES: concurrency
55
// REQUIRES: asserts
6-
// REQUIRES: swift_feature_NonIsolatedAsyncInheritsIsolationFromContext
6+
// REQUIRES: swift_feature_AsyncCallerExecution
77

88
// Validate that both with and without the experimental flag we properly codegen
99
// execution(caller) and execution(concurrent).

test/SILGen/nonisolated_inherits_isolation.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
// RUN: %target-swift-emit-silgen -swift-version 6 -enable-experimental-feature NonIsolatedAsyncInheritsIsolationFromContext %s | %FileCheck %s
1+
// RUN: %target-swift-emit-silgen -swift-version 6 -enable-experimental-feature AsyncCallerExecution %s | %FileCheck %s
22

33
// REQUIRES: concurrency
44
// REQUIRES: asserts
5-
// REQUIRES: swift_feature_NonIsolatedAsyncInheritsIsolationFromContext
5+
// REQUIRES: swift_feature_AsyncCallerExecution
66

77
//===----------------------------------------------------------------------===//
88
// MARK: Declarations

test/Serialization/caller_isolation_inherit.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-swift-frontend -enable-experimental-feature NonIsolatedAsyncInheritsIsolationFromContext -emit-module-path %t/WithFeature.swiftmodule -module-name WithFeature %S/Inputs/caller_inheriting_isolation.swift -swift-version 6
2+
// RUN: %target-swift-frontend -enable-experimental-feature AsyncCallerExecution -emit-module-path %t/WithFeature.swiftmodule -module-name WithFeature %S/Inputs/caller_inheriting_isolation.swift -swift-version 6
33
// RUN: %target-swift-frontend -emit-module-path %t/WithoutFeature.swiftmodule -module-name WithoutFeature %S/Inputs/caller_inheriting_isolation.swift -swift-version 6
44

55
// RUN: %target-swift-frontend -module-name main -I %t %s -emit-sil -o - | %FileCheck %s
66

7-
// RUN: %target-swift-frontend -enable-experimental-feature NonIsolatedAsyncInheritsIsolationFromContext -module-name main -I %t %s -emit-sil -verify -swift-version 6
7+
// RUN: %target-swift-frontend -enable-experimental-feature AsyncCallerExecution -module-name main -I %t %s -emit-sil -verify -swift-version 6
88

99
// REQUIRES: asserts
10-
// REQUIRES: swift_feature_NonIsolatedAsyncInheritsIsolationFromContext
10+
// REQUIRES: swift_feature_AsyncCallerExecution
1111

1212
import WithFeature
1313
import WithoutFeature

test/attr/attr_execution.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// RUN: %target-typecheck-verify-swift -target %target-swift-5.1-abi-triple -enable-experimental-feature NonIsolatedAsyncInheritsIsolationFromContext
1+
// RUN: %target-typecheck-verify-swift -target %target-swift-5.1-abi-triple -enable-experimental-feature AsyncCallerExecution
22

33
// REQUIRES: concurrency
4-
// REQUIRES: swift_feature_NonIsolatedAsyncInheritsIsolationFromContext
4+
// REQUIRES: swift_feature_AsyncCallerExecution
55

66
@execution(something) func invalidAttr() async {} // expected-error {{unknown option 'something' for attribute 'execution'}}
77

0 commit comments

Comments
 (0)