Skip to content

Commit 4d68b70

Browse files
committed
[Concurrency] Use the 'nonisolated' terminology instead of 'independent'.
This commit is NFC; it's mostly renames. (cherry picked from commit a6d078b)
1 parent 4553515 commit 4d68b70

15 files changed

+64
-64
lines changed

include/swift/AST/ActorIsolation.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ class ActorIsolation {
6868
/// For example, a mutable stored property or synchronous function within
6969
/// the actor is isolated to the instance of that actor.
7070
ActorInstance,
71-
/// The declaration is explicitly specified to be independent of any actor,
71+
/// The declaration is explicitly specified to be not isolated to any actor,
7272
/// meaning that it can be used from any actor but is also unable to
7373
/// refer to the isolated state of any given actor.
74-
Independent,
74+
Nonisolated,
7575
/// The declaration is isolated to a global actor. It can refer to other
7676
/// entities with the same global actor.
7777
GlobalActor,
@@ -104,8 +104,8 @@ class ActorIsolation {
104104
return ActorIsolation(Unspecified, nullptr);
105105
}
106106

107-
static ActorIsolation forIndependent() {
108-
return ActorIsolation(Independent, nullptr);
107+
static ActorIsolation forNonisolated() {
108+
return ActorIsolation(Nonisolated, nullptr);
109109
}
110110

111111
static ActorIsolation forActorInstanceSelf(NominalTypeDecl *actor) {
@@ -128,7 +128,7 @@ class ActorIsolation {
128128

129129
bool isUnspecified() const { return kind == Unspecified; }
130130

131-
bool isIndependent() const { return kind == Independent; }
131+
bool isNonisolated() const { return kind == Nonisolated; }
132132

133133
/// Retrieve the parameter to which actor-instance isolation applies.
134134
///
@@ -146,7 +146,7 @@ class ActorIsolation {
146146
return true;
147147

148148
case Unspecified:
149-
case Independent:
149+
case Nonisolated:
150150
return false;
151151
}
152152
}
@@ -195,7 +195,7 @@ class ActorIsolation {
195195
return false;
196196

197197
switch (lhs.getKind()) {
198-
case Independent:
198+
case Nonisolated:
199199
case Unspecified:
200200
return true;
201201

include/swift/AST/Expr.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3778,8 +3778,8 @@ class SequenceExpr final : public Expr,
37783778
class ClosureActorIsolation {
37793779
public:
37803780
enum Kind {
3781-
/// The closure is independent of any actor.
3782-
Independent,
3781+
/// The closure is not isolated to any actor.
3782+
Nonisolated,
37833783

37843784
/// The closure is tied to the actor instance described by the given
37853785
/// \c VarDecl*, which is the (captured) `self` of an actor.
@@ -3810,7 +3810,7 @@ class ClosureActorIsolation {
38103810
ClosureActorIsolation(bool preconcurrency = false)
38113811
: storage(nullptr, preconcurrency) { }
38123812

3813-
static ClosureActorIsolation forIndependent(bool preconcurrency) {
3813+
static ClosureActorIsolation forNonisolated(bool preconcurrency) {
38143814
return ClosureActorIsolation(preconcurrency);
38153815
}
38163816

@@ -3827,7 +3827,7 @@ class ClosureActorIsolation {
38273827
/// Determine the kind of isolation.
38283828
Kind getKind() const {
38293829
if (storage.getPointer().isNull())
3830-
return Kind::Independent;
3830+
return Kind::Nonisolated;
38313831

38323832
if (storage.getPointer().is<VarDecl *>())
38333833
return Kind::ActorInstance;
@@ -3837,7 +3837,7 @@ class ClosureActorIsolation {
38373837

38383838
/// Whether the closure is isolated at all.
38393839
explicit operator bool() const {
3840-
return getKind() != Kind::Independent;
3840+
return getKind() != Kind::Nonisolated;
38413841
}
38423842

38433843
/// Whether the closure is isolated at all.

lib/AST/ASTDumper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2593,7 +2593,7 @@ class PrintExpr : public ExprVisitor<PrintExpr> {
25932593
<< " discriminator=" << E->getRawDiscriminator();
25942594

25952595
switch (auto isolation = E->getActorIsolation()) {
2596-
case ClosureActorIsolation::Independent:
2596+
case ClosureActorIsolation::Nonisolated:
25972597
break;
25982598

25992599
case ClosureActorIsolation::ActorInstance:

lib/AST/Decl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2354,7 +2354,7 @@ static bool deferMatchesEnclosingAccess(const FuncDecl *defer) {
23542354
break;
23552355

23562356
case ActorIsolation::ActorInstance:
2357-
case ActorIsolation::Independent:
2357+
case ActorIsolation::Nonisolated:
23582358
case ActorIsolation::GlobalActor:
23592359
return true;
23602360
}
@@ -10210,7 +10210,7 @@ bool VarDecl::isSelfParamCaptureIsolated() const {
1021010210

1021110211
if (auto closure = dyn_cast<AbstractClosureExpr>(dc)) {
1021210212
switch (auto isolation = closure->getActorIsolation()) {
10213-
case ClosureActorIsolation::Independent:
10213+
case ClosureActorIsolation::Nonisolated:
1021410214
case ClosureActorIsolation::GlobalActor:
1021510215
return false;
1021610216

lib/AST/DiagnosticEngine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ static void formatDiagnosticArgument(StringRef Modifier,
920920
break;
921921
}
922922

923-
case ActorIsolation::Independent:
923+
case ActorIsolation::Nonisolated:
924924
case ActorIsolation::Unspecified:
925925
Out << "nonisolated";
926926
break;

lib/AST/Expr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,8 +1875,8 @@ RebindSelfInConstructorExpr::getCalledConstructor(bool &isChainToSuper) const {
18751875

18761876
ActorIsolation ClosureActorIsolation::getActorIsolation() const {
18771877
switch (getKind()) {
1878-
case ClosureActorIsolation::Independent:
1879-
return ActorIsolation::forIndependent().withPreconcurrency(
1878+
case ClosureActorIsolation::Nonisolated:
1879+
return ActorIsolation::forNonisolated().withPreconcurrency(
18801880
preconcurrency());
18811881

18821882
case ClosureActorIsolation::GlobalActor: {

lib/AST/TypeCheckRequests.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,7 +1605,7 @@ SourceLoc MacroDefinitionRequest::getNearestLoc() const {
16051605
bool ActorIsolation::requiresSubstitution() const {
16061606
switch (kind) {
16071607
case ActorInstance:
1608-
case Independent:
1608+
case Nonisolated:
16091609
case Unspecified:
16101610
return false;
16111611

@@ -1619,7 +1619,7 @@ bool ActorIsolation::requiresSubstitution() const {
16191619
ActorIsolation ActorIsolation::subst(SubstitutionMap subs) const {
16201620
switch (kind) {
16211621
case ActorInstance:
1622-
case Independent:
1622+
case Nonisolated:
16231623
case Unspecified:
16241624
return *this;
16251625

@@ -1643,8 +1643,8 @@ void swift::simple_display(
16431643
out << "actor " << state.getActor()->getName();
16441644
break;
16451645

1646-
case ActorIsolation::Independent:
1647-
out << "actor-independent";
1646+
case ActorIsolation::Nonisolated:
1647+
out << "nonisolated";
16481648
break;
16491649

16501650
case ActorIsolation::Unspecified:

lib/IDE/CompletionLookup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ void CompletionLookup::analyzeActorIsolation(
788788
break;
789789
}
790790
case ActorIsolation::Unspecified:
791-
case ActorIsolation::Independent:
791+
case ActorIsolation::Nonisolated:
792792
return;
793793
}
794794

lib/SILGen/SILGenApply.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5514,7 +5514,7 @@ RValue SILGenFunction::emitApply(
55145514
break;
55155515

55165516
case ActorIsolation::Unspecified:
5517-
case ActorIsolation::Independent:
5517+
case ActorIsolation::Nonisolated:
55185518
llvm_unreachable("Not isolated");
55195519
break;
55205520
}

lib/SILGen/SILGenConstructor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ static bool ctorHopsInjectedByDefiniteInit(ConstructorDecl *ctor,
595595
return true;
596596

597597
case ActorIsolation::Unspecified:
598-
case ActorIsolation::Independent:
598+
case ActorIsolation::Nonisolated:
599599
case ActorIsolation::GlobalActor:
600600
case ActorIsolation::GlobalActorUnsafe:
601601
return false;

0 commit comments

Comments
 (0)