|
1 | | -//===-- Sema/AsyncCallerExecutionMigration.cpp ------------------*- C++ -*-===// |
| 1 | +//===-- Sema/NonisolatedNonsendingByDefaultMigration.cpp --------*- C++ -*-===// |
2 | 2 | // |
3 | 3 | // This source file is part of the Swift.org open source project |
4 | 4 | // |
|
11 | 11 | //===----------------------------------------------------------------------===// |
12 | 12 | /// |
13 | 13 | /// \file |
14 | | -/// This file implements code migration support for the `AsyncCallerExecution` |
15 | | -/// feature. |
| 14 | +/// This file implements code migration support for the |
| 15 | +/// `NonisolatedNonsendingByDefault` feature. |
16 | 16 | /// |
17 | 17 | //===----------------------------------------------------------------------===// |
18 | 18 |
|
19 | | -#include "AsyncCallerExecutionMigration.h" |
| 19 | +#include "NonisolatedNonsendingByDefaultMigration.h" |
20 | 20 | #include "swift/AST/ASTContext.h" |
21 | 21 | #include "swift/AST/Decl.h" |
22 | 22 | #include "swift/AST/DiagnosticsSema.h" |
|
30 | 30 | using namespace swift; |
31 | 31 |
|
32 | 32 | namespace { |
33 | | -class AsyncCallerExecutionMigrationTarget { |
| 33 | +class NonisolatedNonsendingByDefaultMigrationTarget { |
34 | 34 | ASTContext &ctx; |
35 | 35 | PointerUnion<ValueDecl *, AbstractClosureExpr *, FunctionTypeRepr *> node; |
36 | 36 | TaggedUnion<ActorIsolation, FunctionTypeIsolation> isolation; |
37 | 37 |
|
38 | 38 | public: |
39 | | - AsyncCallerExecutionMigrationTarget(ASTContext &ctx, ValueDecl *decl, |
| 39 | + NonisolatedNonsendingByDefaultMigrationTarget(ASTContext &ctx, ValueDecl *decl, |
40 | 40 | ActorIsolation isolation) |
41 | 41 | : ctx(ctx), node(decl), isolation(isolation) {} |
42 | 42 |
|
43 | | - AsyncCallerExecutionMigrationTarget(ASTContext &ctx, |
| 43 | + NonisolatedNonsendingByDefaultMigrationTarget(ASTContext &ctx, |
44 | 44 | AbstractClosureExpr *closure, |
45 | 45 | ActorIsolation isolation) |
46 | 46 | : ctx(ctx), node(closure), isolation(isolation) {} |
47 | 47 |
|
48 | | - AsyncCallerExecutionMigrationTarget(ASTContext &ctx, FunctionTypeRepr *repr, |
| 48 | + NonisolatedNonsendingByDefaultMigrationTarget(ASTContext &ctx, FunctionTypeRepr *repr, |
49 | 49 | FunctionTypeIsolation isolation) |
50 | 50 | : ctx(ctx), node(repr), isolation(isolation) {} |
51 | 51 |
|
52 | 52 | /// Warns that the behavior of nonisolated async functions will change under |
53 | | - /// `AsyncCallerExecution` and suggests `@concurrent` to preserve the current |
| 53 | + /// `NonisolatedNonsendingByDefault` and suggests `@concurrent` to preserve the current |
54 | 54 | /// behavior. |
55 | 55 | void diagnose() const; |
56 | 56 | }; |
57 | 57 | } // end anonymous namespace |
58 | 58 |
|
59 | | -void AsyncCallerExecutionMigrationTarget::diagnose() const { |
60 | | - const auto feature = Feature::AsyncCallerExecution; |
| 59 | +void NonisolatedNonsendingByDefaultMigrationTarget::diagnose() const { |
| 60 | + const auto feature = Feature::NonisolatedNonsendingByDefault; |
61 | 61 |
|
62 | 62 | ASSERT(node); |
63 | 63 | ASSERT(ctx.LangOpts.getFeatureState(feature).isEnabledForAdoption()); |
@@ -189,15 +189,15 @@ void AsyncCallerExecutionMigrationTarget::diagnose() const { |
189 | 189 |
|
190 | 190 | void swift::warnAboutNewNonisolatedAsyncExecutionBehavior( |
191 | 191 | ASTContext &ctx, FunctionTypeRepr *repr, FunctionTypeIsolation isolation) { |
192 | | - AsyncCallerExecutionMigrationTarget(ctx, repr, isolation).diagnose(); |
| 192 | + NonisolatedNonsendingByDefaultMigrationTarget(ctx, repr, isolation).diagnose(); |
193 | 193 | } |
194 | 194 |
|
195 | 195 | void swift::warnAboutNewNonisolatedAsyncExecutionBehavior( |
196 | 196 | ASTContext &ctx, ValueDecl *decl, ActorIsolation isolation) { |
197 | | - AsyncCallerExecutionMigrationTarget(ctx, decl, isolation).diagnose(); |
| 197 | + NonisolatedNonsendingByDefaultMigrationTarget(ctx, decl, isolation).diagnose(); |
198 | 198 | } |
199 | 199 |
|
200 | 200 | void swift::warnAboutNewNonisolatedAsyncExecutionBehavior( |
201 | 201 | ASTContext &ctx, AbstractClosureExpr *closure, ActorIsolation isolation) { |
202 | | - AsyncCallerExecutionMigrationTarget(ctx, closure, isolation).diagnose(); |
| 202 | + NonisolatedNonsendingByDefaultMigrationTarget(ctx, closure, isolation).diagnose(); |
203 | 203 | } |
0 commit comments