Skip to content

Commit 0802584

Browse files
committed
[AST] Remove ExecutionAttribute experimental feature
SE-0461 has been accepted and `@concurrent` and `nonisolated(nonsending)` can be make generally available now.
1 parent 2d81f60 commit 0802584

20 files changed

+24
-94
lines changed

include/swift/AST/DeclAttr.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,6 @@ SIMPLE_DECL_ATTR(concurrent, Concurrent,
879879
OnFunc | OnConstructor | OnSubscript | OnVar,
880880
ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove | UnconstrainedInABIAttr,
881881
170)
882-
DECL_ATTR_FEATURE_REQUIREMENT(Concurrent, ExecutionAttribute)
883882

884883
LAST_DECL_ATTR(Concurrent)
885884

include/swift/AST/PrintOptions.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,6 @@ struct PrintOptions {
397397
/// Suppress modify/read accessors.
398398
bool SuppressCoroutineAccessors = false;
399399

400-
/// Suppress the @execution attribute
401-
bool SuppressExecutionAttribute = false;
402-
403400
/// List of attribute kinds that should not be printed.
404401
std::vector<AnyAttrKind> ExcludeAttrList = {
405402
DeclAttrKind::Transparent, DeclAttrKind::Effects,

include/swift/Basic/Features.def

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,6 @@ SUPPRESSIBLE_EXPERIMENTAL_FEATURE(AddressableTypes, true)
486486
/// Allow the @abi attribute.
487487
SUPPRESSIBLE_EXPERIMENTAL_FEATURE(ABIAttribute, true)
488488

489-
/// Allow the @execution attribute. This is also connected to
490-
/// AsyncCallerExecution feature.
491-
SUPPRESSIBLE_EXPERIMENTAL_FEATURE(ExecutionAttribute, false)
492-
493489
/// Functions with nonisolated isolation inherit their isolation from the
494490
/// calling context.
495491
ADOPTABLE_EXPERIMENTAL_FEATURE(AsyncCallerExecution, false)

lib/AST/ASTPrinter.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3301,14 +3301,6 @@ suppressingFeatureAddressableTypes(PrintOptions &options,
33013301
action();
33023302
}
33033303

3304-
static void
3305-
suppressingFeatureExecutionAttribute(PrintOptions &options,
3306-
llvm::function_ref<void()> action) {
3307-
llvm::SaveAndRestore<bool> scope1(options.SuppressExecutionAttribute, true);
3308-
ExcludeAttrRAII scope2(options.ExcludeAttrList, DeclAttrKind::Concurrent);
3309-
action();
3310-
}
3311-
33123304
/// Suppress the printing of a particular feature.
33133305
static void suppressingFeature(PrintOptions &options, Feature feature,
33143306
llvm::function_ref<void()> action) {

lib/AST/FeatureSet.cpp

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -503,48 +503,6 @@ static bool usesFeatureBuiltinEmplaceTypedThrows(Decl *decl) {
503503
return false;
504504
}
505505

506-
static bool usesFeatureExecutionAttribute(Decl *decl) {
507-
if (!DeclAttribute::canAttributeAppearOnDecl(DeclAttrKind::Concurrent,
508-
decl)) {
509-
return false;
510-
}
511-
512-
if (decl->getAttrs().hasAttribute<ConcurrentAttr>())
513-
return true;
514-
515-
auto hasConcurrentAttr = [](TypeRepr *R) {
516-
if (!R)
517-
return false;
518-
519-
return R->findIf([](TypeRepr *repr) {
520-
if (auto *AT = dyn_cast<AttributedTypeRepr>(repr)) {
521-
return llvm::any_of(AT->getAttrs(), [](TypeOrCustomAttr attr) {
522-
if (auto *TA = attr.dyn_cast<TypeAttribute *>()) {
523-
return isa<ConcurrentTypeAttr>(TA);
524-
}
525-
return false;
526-
});
527-
}
528-
return false;
529-
});
530-
};
531-
532-
auto *VD = cast<ValueDecl>(decl);
533-
534-
// Check if any parameters that have `@execution` attribute.
535-
if (auto *PL = VD->getParameterList()) {
536-
for (auto *P : *PL) {
537-
if (hasConcurrentAttr(P->getTypeRepr()))
538-
return true;
539-
}
540-
}
541-
542-
if (hasConcurrentAttr(VD->getResultTypeRepr()))
543-
return true;
544-
545-
return false;
546-
}
547-
548506
// ----------------------------------------------------------------------------
549507
// MARK: - FeatureSet
550508
// ----------------------------------------------------------------------------

test/ASTGen/attrs.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
// RUN: %target-swift-frontend-dump-parse \
44
// RUN: -enable-experimental-feature ABIAttribute \
5-
// RUN: -enable-experimental-feature ExecutionAttribute \
65
// RUN: -enable-experimental-feature Extern \
76
// RUN: -enable-experimental-feature LifetimeDependence \
87
// RUN: -enable-experimental-feature RawLayout \
@@ -14,7 +13,6 @@
1413

1514
// RUN: %target-swift-frontend-dump-parse \
1615
// RUN: -enable-experimental-feature ABIAttribute \
17-
// RUN: -enable-experimental-feature ExecutionAttribute \
1816
// RUN: -enable-experimental-feature Extern \
1917
// RUN: -enable-experimental-feature LifetimeDependence \
2018
// RUN: -enable-experimental-feature RawLayout \
@@ -29,7 +27,6 @@
2927
// RUN: -module-abi-name ASTGen \
3028
// RUN: -enable-experimental-feature ParserASTGen \
3129
// RUN: -enable-experimental-feature ABIAttribute \
32-
// RUN: -enable-experimental-feature ExecutionAttribute \
3330
// RUN: -enable-experimental-feature Extern \
3431
// RUN: -enable-experimental-feature LifetimeDependence \
3532
// RUN: -enable-experimental-feature RawLayout \
@@ -42,7 +39,6 @@
4239
// REQUIRES: swift_swift_parser
4340
// REQUIRES: swift_feature_ParserASTGen
4441
// REQUIRES: swift_feature_ABIAttribute
45-
// REQUIRES: swift_feature_ExecutionAttribute
4642
// REQUIRES: swift_feature_Extern
4743
// REQUIRES: swift_feature_LifetimeDependence
4844
// REQUIRES: swift_feature_RawLayout

test/Concurrency/Runtime/nonisolated_inherits_isolation.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
// RUN: %target-run-simple-swift( -swift-version 6 -g %import-libdispatch -import-objc-header %S/Inputs/RunOnMainActor.h -enable-experimental-feature ExecutionAttribute -enable-experimental-feature AsyncCallerExecution )
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_ExecutionAttribute
109
// REQUIRES: swift_feature_AsyncCallerExecution
1110

1211
// UNSUPPORTED: freestanding

test/Concurrency/attr_execution/adoption_mode.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
// RUN: %target-typecheck-verify-swift -target %target-swift-5.1-abi-triple -swift-version 5 -enable-experimental-feature ExecutionAttribute -enable-experimental-feature AsyncCallerExecution:adoption
2-
// RUN: %target-typecheck-verify-swift -target %target-swift-5.1-abi-triple -swift-version 6 -enable-experimental-feature ExecutionAttribute -enable-experimental-feature AsyncCallerExecution:adoption
1+
// RUN: %target-typecheck-verify-swift -target %target-swift-5.1-abi-triple -swift-version 5 -enable-experimental-feature AsyncCallerExecution:adoption
2+
// RUN: %target-typecheck-verify-swift -target %target-swift-5.1-abi-triple -swift-version 6 -enable-experimental-feature AsyncCallerExecution:adoption
33

4-
// REQUIRES: swift_feature_ExecutionAttribute
54
// REQUIRES: swift_feature_AsyncCallerExecution
65

76
struct G<T> {

test/Concurrency/attr_execution/attr_execution.swift

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

3-
// REQUIRES: swift_feature_ExecutionAttribute
43
// REQUIRES: swift_feature_AsyncCallerExecution
54

65

test/Concurrency/attr_execution/conversions.swift

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

33
// REQUIRES: concurrency
4-
// REQUIRES: swift_feature_ExecutionAttribute
54

65
@globalActor
76
actor MyActor {

0 commit comments

Comments
 (0)