Skip to content

Commit a6d078b

Browse files
committed
[Concurrency] Use the 'nonisolated' terminology instead of 'independent'.
This commit is NFC; it's mostly renames.
1 parent 2c3c3c1 commit a6d078b

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
@@ -2313,7 +2313,7 @@ static bool deferMatchesEnclosingAccess(const FuncDecl *defer) {
23132313
break;
23142314

23152315
case ActorIsolation::ActorInstance:
2316-
case ActorIsolation::Independent:
2316+
case ActorIsolation::Nonisolated:
23172317
case ActorIsolation::GlobalActor:
23182318
return true;
23192319
}
@@ -10166,7 +10166,7 @@ bool VarDecl::isSelfParamCaptureIsolated() const {
1016610166

1016710167
if (auto closure = dyn_cast<AbstractClosureExpr>(dc)) {
1016810168
switch (auto isolation = closure->getActorIsolation()) {
10169-
case ClosureActorIsolation::Independent:
10169+
case ClosureActorIsolation::Nonisolated:
1017010170
case ClosureActorIsolation::GlobalActor:
1017110171
return false;
1017210172

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
@@ -1607,7 +1607,7 @@ SourceLoc MacroDefinitionRequest::getNearestLoc() const {
16071607
bool ActorIsolation::requiresSubstitution() const {
16081608
switch (kind) {
16091609
case ActorInstance:
1610-
case Independent:
1610+
case Nonisolated:
16111611
case Unspecified:
16121612
return false;
16131613

@@ -1621,7 +1621,7 @@ bool ActorIsolation::requiresSubstitution() const {
16211621
ActorIsolation ActorIsolation::subst(SubstitutionMap subs) const {
16221622
switch (kind) {
16231623
case ActorInstance:
1624-
case Independent:
1624+
case Nonisolated:
16251625
case Unspecified:
16261626
return *this;
16271627

@@ -1645,8 +1645,8 @@ void swift::simple_display(
16451645
out << "actor " << state.getActor()->getName();
16461646
break;
16471647

1648-
case ActorIsolation::Independent:
1649-
out << "actor-independent";
1648+
case ActorIsolation::Nonisolated:
1649+
out << "nonisolated";
16501650
break;
16511651

16521652
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)