Skip to content

Commit db79596

Browse files
committed
[Frontend] NFC: Rename PreconcurrencyConformances to DynamicActorIsolation
1 parent 68baadc commit db79596

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
@@ -5642,7 +5642,7 @@ ERROR(preconcurrency_not_inheritance_clause,none,
56425642
ERROR(preconcurrency_not_existential,none,
56435643
"'preconcurrency' attribute cannot apply to non-protocol type %0", (Type))
56445644
ERROR(preconcurrency_attr_disabled,none,
5645-
"attribute requires '-enable-experimental-feature PreconcurrencyConformances'", ())
5645+
"attribute requires '-enable-experimental-feature DynamicActorIsolation'", ())
56465646

56475647
ERROR(redundant_any_in_existential,none,
56485648
"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
@@ -3876,7 +3876,7 @@ static bool usesFeatureTransferringArgsAndResults(Decl *decl) {
38763876
return false;
38773877
}
38783878

3879-
static bool usesFeaturePreconcurrencyConformances(Decl *decl) {
3879+
static bool usesFeatureDynamicActorIsolation(Decl *decl) {
38803880
auto usesPreconcurrencyConformance = [&](const InheritedTypes &inherited) {
38813881
return llvm::any_of(
38823882
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

0 commit comments

Comments
 (0)