Skip to content

Commit 2bbe594

Browse files
committed
[Frontend] NFC: Rename PreconcurrencyConformances to DynamicActorIsolation
1 parent ab8951a commit 2bbe594

13 files changed

+29
-27
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5639,7 +5639,7 @@ ERROR(preconcurrency_not_inheritance_clause,none,
56395639
ERROR(preconcurrency_not_existential,none,
56405640
"'preconcurrency' attribute cannot apply to non-protocol type %0", (Type))
56415641
ERROR(preconcurrency_attr_disabled,none,
5642-
"attribute requires '-enable-experimental-feature PreconcurrencyConformances'", ())
5642+
"attribute requires '-enable-experimental-feature DynamicActorIsolation'", ())
56435643

56445644
ERROR(redundant_any_in_existential,none,
56455645
"redundant 'any' in type %0",

include/swift/Basic/Features.def

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,10 @@ EXPERIMENTAL_FEATURE(GroupActorErrors, true)
271271
// Allow for the 'transferring' keyword to be applied to arguments and results.
272272
EXPERIMENTAL_FEATURE(TransferringArgsAndResults, true)
273273

274-
// Enable `@preconcurrency` attribute on protocol conformances.
275-
EXPERIMENTAL_FEATURE(PreconcurrencyConformances, false)
274+
// Enable `@preconcurrency` attribute on protocol conformances and runtime checks
275+
// of actor isolation in @obj thunks and arguments of APIs that haven't yet adopted
276+
// strict concurrency checking.
277+
EXPERIMENTAL_FEATURE(DynamicActorIsolation, false)
276278

277279
// Allow for `switch` of noncopyable values to be borrowing or consuming.
278280
EXPERIMENTAL_FEATURE(BorrowingSwitch, true)

lib/AST/ASTPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3918,7 +3918,7 @@ static bool usesFeatureTransferringArgsAndResults(Decl *decl) {
39183918
return false;
39193919
}
39203920

3921-
static bool usesFeaturePreconcurrencyConformances(Decl *decl) {
3921+
static bool usesFeatureDynamicActorIsolation(Decl *decl) {
39223922
auto usesPreconcurrencyConformance = [&](const InheritedTypes &inherited) {
39233923
return llvm::any_of(
39243924
inherited.getEntries(),

lib/SILGen/SILGenBridging.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1594,7 +1594,7 @@ void SILGenFunction::emitNativeToForeignThunk(SILDeclRef thunk) {
15941594
Scope scope(Cleanups, CleanupLocation(loc));
15951595

15961596
bool emitExecutorPrecondition =
1597-
getASTContext().LangOpts.hasFeature(Feature::PreconcurrencyConformances);
1597+
getASTContext().LangOpts.hasFeature(Feature::DynamicActorIsolation);
15981598

15991599
llvm::Optional<ActorIsolation> isolation;
16001600
if (F.isAsync()) {

lib/Sema/CSApply.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7416,7 +7416,7 @@ Expr *ExprRewriter::coerceToType(Expr *expr, Type toType,
74167416
}
74177417
}
74187418

7419-
if (ctx.LangOpts.hasFeature(Feature::PreconcurrencyConformances)) {
7419+
if (ctx.LangOpts.hasFeature(Feature::DynamicActorIsolation)) {
74207420
// Passing a synchronous global actor-isolated function value and
74217421
// parameter that expects a synchronous non-isolated function type could
74227422
// require a runtime check to ensure that function is always called in

lib/Sema/TypeCheckType.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3347,7 +3347,7 @@ TypeResolver::resolveAttributedType(TypeRepr *repr, TypeResolutionOptions option
33473347

33483348
if (auto preconcurrencyAttr = claim<PreconcurrencyTypeAttr>(attrs)) {
33493349
auto &ctx = getASTContext();
3350-
if (ctx.LangOpts.hasFeature(Feature::PreconcurrencyConformances)) {
3350+
if (ctx.LangOpts.hasFeature(Feature::DynamicActorIsolation)) {
33513351
if (ty->hasError())
33523352
return ty;
33533353

test/ClangImporter/preconcurrency_conformances.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -disable-availability-checking -enable-experimental-feature PreconcurrencyConformances -emit-silgen %s | %FileCheck %s
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -disable-availability-checking -enable-experimental-feature DynamicActorIsolation -emit-silgen %s | %FileCheck %s
22

33
// REQUIRES: asserts
44
// REQUIRES: concurrency

test/Concurrency/dynamic_checks_for_func_refs_in_preconcurrency_apis.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// RUN: -I %t \
1313
// RUN: -disable-availability-checking \
1414
// RUN: -module-name Client \
15-
// RUN: -enable-experimental-feature PreconcurrencyConformances \
15+
// RUN: -enable-experimental-feature DynamicActorIsolation \
1616
// RUN: %t/src/Client.swift -verify | %FileCheck %s
1717

1818
// Delete swiftmodule to test building against swiftinterface
@@ -23,7 +23,7 @@
2323
// RUN: -I %t \
2424
// RUN: -disable-availability-checking \
2525
// RUN: -module-name Client \
26-
// RUN: -enable-experimental-feature PreconcurrencyConformances \
26+
// RUN: -enable-experimental-feature DynamicActorIsolation \
2727
// RUN: %t/src/Client.swift -verify | %FileCheck %s
2828

2929
// REQUIRES: asserts

test/Concurrency/dynamic_checks_for_func_refs_in_preconcurrency_apis_objc.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-experimental-feature PreconcurrencyConformances -emit-silgen -verify %s | %FileCheck %s
1+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-experimental-feature DynamicActorIsolation -emit-silgen -verify %s | %FileCheck %s
22
// REQUIRES: objc_interop
33

44
import Foundation

test/Concurrency/preconcurrency_conformances.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -swift-version 5 -disable-availability-checking %s -emit-sil -o /dev/null -verify -enable-experimental-feature PreconcurrencyConformances -strict-concurrency=complete -verify-additional-prefix complete-tns-
1+
// RUN: %target-swift-frontend -swift-version 5 -disable-availability-checking %s -emit-sil -o /dev/null -verify -enable-experimental-feature DynamicActorIsolation -strict-concurrency=complete -verify-additional-prefix complete-tns-
22

33
// REQUIRES: concurrency
44
// REQUIRES: asserts

test/Interpreter/preconcurrency_conformances.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@
1212
// RUN: -target %target-cpu-apple-macosx10.15 \
1313
// RUN: -I %t -L %t -l Interface \
1414
// RUN: -emit-module-interface-path %t/Types.swiftinterface \
15-
// RUN: -Xfrontend -enable-experimental-feature -Xfrontend PreconcurrencyConformances
15+
// RUN: -Xfrontend -enable-experimental-feature -Xfrontend DynamicActorIsolation
1616

17-
// RUN: %target-build-swift -Xfrontend -enable-experimental-feature -Xfrontend PreconcurrencyConformances -I %t -L %t -l Types %t/src/Crash1.swift -o %t/crash1.out
17+
// RUN: %target-build-swift -Xfrontend -enable-experimental-feature -Xfrontend DynamicActorIsolation -I %t -L %t -l Types %t/src/Crash1.swift -o %t/crash1.out
1818
// RUN: %target-codesign %t/crash1.out
1919
// RUN: not --crash env SWIFT_UNEXPECTED_EXECUTOR_LOG_LEVEL=2 %target-run %t/crash1.out 2>&1 | %FileCheck %t/src/Crash1.swift
2020

21-
// RUN: %target-build-swift -Xfrontend -enable-experimental-feature -Xfrontend PreconcurrencyConformances -I %t -L %t -l Types %t/src/Crash2.swift -o %t/crash2.out
21+
// RUN: %target-build-swift -Xfrontend -enable-experimental-feature -Xfrontend DynamicActorIsolation -I %t -L %t -l Types %t/src/Crash2.swift -o %t/crash2.out
2222
// RUN: %target-codesign %t/crash2.out
2323
// RUN: not --crash env SWIFT_UNEXPECTED_EXECUTOR_LOG_LEVEL=2 %target-run %t/crash2.out 2>&1 | %FileCheck %t/src/Crash2.swift
2424

25-
// RUN: %target-build-swift -Xfrontend -enable-experimental-feature -Xfrontend PreconcurrencyConformances -I %t -L %t -l Types %t/src/Crash3.swift -o %t/crash3.out
25+
// RUN: %target-build-swift -Xfrontend -enable-experimental-feature -Xfrontend DynamicActorIsolation -I %t -L %t -l Types %t/src/Crash3.swift -o %t/crash3.out
2626
// RUN: %target-codesign %t/crash3.out
2727
// RUN: not --crash env SWIFT_UNEXPECTED_EXECUTOR_LOG_LEVEL=2 %target-run %t/crash3.out 2>&1 | %FileCheck %t/src/Crash3.swift
2828

29-
// RUN: %target-build-swift -Xfrontend -enable-experimental-feature -Xfrontend PreconcurrencyConformances -I %t -L %t -l Types %t/src/Crash4.swift -o %t/crash4.out
29+
// RUN: %target-build-swift -Xfrontend -enable-experimental-feature -Xfrontend DynamicActorIsolation -I %t -L %t -l Types %t/src/Crash4.swift -o %t/crash4.out
3030
// RUN: %target-codesign %t/crash4.out
3131
// RUN: not --crash env SWIFT_UNEXPECTED_EXECUTOR_LOG_LEVEL=2 %target-run %t/crash4.out 2>&1 | %FileCheck %t/src/Crash4.swift
3232

test/ModuleInterface/preconcurrency_conformances.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@
1212
// RUN: -module-name Client -I %t -swift-version 5 -enable-library-evolution \
1313
// RUN: -emit-module-path %t/Client.swiftmodule \
1414
// RUN: -emit-module-interface-path %t/Client.swiftinterface \
15-
// RUN: -enable-experimental-feature PreconcurrencyConformances \
15+
// RUN: -enable-experimental-feature DynamicActorIsolation \
1616
// RUN: -disable-availability-checking \
1717
// RUN: -verify
1818

1919
// RUN: %FileCheck %s < %t/Client.swiftinterface
2020

2121
// RUN: %target-swift-emit-module-interface(%t/Client.swiftinterface) -I %t %t/src/Client.swift -module-name Client \
22-
// RUN: -disable-availability-checking -enable-experimental-feature PreconcurrencyConformances -verify
22+
// RUN: -disable-availability-checking -enable-experimental-feature DynamicActorIsolation -verify
2323

2424
// RUN: %target-swift-typecheck-module-from-interface(%t/Client.swiftinterface) -I %t -module-name Client \
25-
// RUN: -disable-availability-checking -enable-experimental-feature PreconcurrencyConformances -verify
25+
// RUN: -disable-availability-checking -enable-experimental-feature DynamicActorIsolation -verify
2626

2727
// REQUIRES: asserts
2828
// REQUIRES: concurrency
@@ -44,7 +44,7 @@ public protocol WithAssoc {
4444
//--- Client.swift
4545
import A
4646

47-
// CHECK: #if {{.*}} $PreconcurrencyConformances
47+
// CHECK: #if {{.*}} $DynamicActorIsolation
4848
// CHECK-NEXT: @_Concurrency.MainActor public struct GlobalActorTest : @preconcurrency A.P
4949

5050
@MainActor
@@ -56,13 +56,13 @@ public struct GlobalActorTest : @preconcurrency P {
5656
public class ExtTest {
5757
}
5858

59-
// CHECK: #if {{.*}} $PreconcurrencyConformances
59+
// CHECK: #if {{.*}} $DynamicActorIsolation
6060
// CHECK-NEXT: extension Client.ExtTest : @preconcurrency A.P
6161
extension ExtTest : @preconcurrency P {
6262
public func test() -> Int { 1 }
6363
}
6464

65-
// CHECK: #if {{.*}} && $PreconcurrencyConformances
65+
// CHECK: #if {{.*}} && $DynamicActorIsolation
6666
// CHECK-NEXT: public actor ActorTest : @preconcurrency A.P
6767
public actor ActorTest : @preconcurrency P {
6868
public func test() -> Int { 2 }
@@ -71,22 +71,22 @@ public actor ActorTest : @preconcurrency P {
7171
public actor ActorExtTest {
7272
}
7373

74-
// CHECK: #if {{.*}} $PreconcurrencyConformances
74+
// CHECK: #if {{.*}} $DynamicActorIsolation
7575
// CHECK-NEXT: extension Client.ActorExtTest : @preconcurrency A.Q
7676
extension ActorExtTest : @preconcurrency Q {
7777
public var x: Int { 42 }
7878
}
7979

8080
public struct TestConditional<T> {}
8181

82-
// CHECK: #if {{.*}} $PreconcurrencyConformances
82+
// CHECK: #if {{.*}} $DynamicActorIsolation
8383
// CHECK-NEXT: extension Client.TestConditional : @preconcurrency A.WithAssoc where T == Swift.Int {
8484
// CHECK-NEXT: @_Concurrency.MainActor public func test() -> T
8585
// CHECK-NEXT: }
8686
extension TestConditional : @preconcurrency WithAssoc where T == Int {
8787
@MainActor public func test() -> T { 42 } // Ok
8888
}
8989

90-
// CHECK: #if {{.*}} $PreconcurrencyConformances
90+
// CHECK: #if {{.*}} $DynamicActorIsolation
9191
// CHECK-NEXT: extension Client.GlobalActorTest : Swift.Sendable {}
9292
// CHECK-NEXT: #endif

test/SILGen/preconcurrency_conformances.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-emit-silgen -disable-availability-checking -module-name preconcurrency_conformances -enable-experimental-feature PreconcurrencyConformances %s -verify | %FileCheck %s
1+
// RUN: %target-swift-emit-silgen -disable-availability-checking -module-name preconcurrency_conformances -enable-experimental-feature DynamicActorIsolation %s -verify | %FileCheck %s
22

33
// REQUIRES: asserts
44
// REQUIRES: concurrency

0 commit comments

Comments
 (0)