Skip to content

Commit 4b23564

Browse files
committed
[Concurrency] Rename AbstractClosureExpr::getActorIsolation to
getClosureActorIsolation. This is preparation for changing AbstractClosureExpr to store ActorIsolation instead of ClosureActorIsolation, and convert to ClosureActorIsolation when needed to allow incrementally updating callers. This change is NFC.
1 parent 7014fcf commit 4b23564

File tree

7 files changed

+10
-8
lines changed

7 files changed

+10
-8
lines changed

include/swift/AST/Expr.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3951,7 +3951,9 @@ class AbstractClosureExpr : public DeclContext, public Expr {
39513951
/// returns nullptr if the closure doesn't have a body
39523952
BraceStmt *getBody() const;
39533953

3954-
ClosureActorIsolation getActorIsolation() const { return actorIsolation; }
3954+
ClosureActorIsolation getClosureActorIsolation() const {
3955+
return actorIsolation;
3956+
}
39553957

39563958
void setActorIsolation(ClosureActorIsolation actorIsolation) {
39573959
this->actorIsolation = actorIsolation;

lib/AST/ASTDumper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2687,7 +2687,7 @@ class PrintExpr : public ExprVisitor<PrintExpr, void, StringRef>,
26872687

26882688
printField(E->getRawDiscriminator(), "discriminator", DiscriminatorColor);
26892689

2690-
switch (auto isolation = E->getActorIsolation()) {
2690+
switch (auto isolation = E->getClosureActorIsolation()) {
26912691
case ClosureActorIsolation::Nonisolated:
26922692
break;
26932693

lib/AST/Decl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10305,7 +10305,7 @@ bool VarDecl::isSelfParamCaptureIsolated() const {
1030510305
}
1030610306

1030710307
if (auto closure = dyn_cast<AbstractClosureExpr>(dc)) {
10308-
switch (auto isolation = closure->getActorIsolation()) {
10308+
switch (auto isolation = closure->getClosureActorIsolation()) {
1030910309
case ClosureActorIsolation::Nonisolated:
1031010310
case ClosureActorIsolation::GlobalActor:
1031110311
return false;

lib/AST/Expr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2019,7 +2019,7 @@ Expr *AbstractClosureExpr::getSingleExpressionBody() const {
20192019

20202020
ClosureActorIsolation
20212021
swift::__AbstractClosureExpr_getActorIsolation(AbstractClosureExpr *CE) {
2022-
return CE->getActorIsolation();
2022+
return CE->getClosureActorIsolation();
20232023
}
20242024

20252025
llvm::function_ref<ClosureActorIsolation(AbstractClosureExpr *)>

lib/IDE/CompletionLookup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ void CompletionLookup::analyzeActorIsolation(
777777
if (isolation != ClosureActorIsolations.end()) {
778778
return isolation->second;
779779
} else {
780-
return CE->getActorIsolation();
780+
return CE->getClosureActorIsolation();
781781
}
782782
};
783783
auto contextIsolation = getActorIsolationOfContext(

lib/SILGen/SILGenProlog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,7 +1380,7 @@ void SILGenFunction::emitProlog(
13801380
}
13811381
} else if (auto *closureExpr = dyn_cast<AbstractClosureExpr>(FunctionDC)) {
13821382
bool wantExecutor = F.isAsync() || wantDataRaceChecks;
1383-
auto actorIsolation = closureExpr->getActorIsolation();
1383+
auto actorIsolation = closureExpr->getClosureActorIsolation();
13841384
switch (actorIsolation.getKind()) {
13851385
case ClosureActorIsolation::Nonisolated:
13861386
break;
@@ -1593,7 +1593,7 @@ void SILGenFunction::emitHopToActorValue(SILLocation loc, ManagedValue actor) {
15931593
}
15941594
auto isolation =
15951595
getActorIsolationOfContext(FunctionDC, [](AbstractClosureExpr *CE) {
1596-
return CE->getActorIsolation();
1596+
return CE->getClosureActorIsolation();
15971597
});
15981598
if (isolation != ActorIsolation::Nonisolated
15991599
&& isolation != ActorIsolation::Unspecified) {

lib/Sema/CSSimplify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2968,7 +2968,7 @@ static bool okToRemoveGlobalActor(ConstraintSystem &cs,
29682968
// So, I expect the existing isolation to always be set to the default.
29692969
// If the assertion below starts tripping, then this ad-hoc inference
29702970
// is no longer needed!
2971-
auto existingIso = ace->getActorIsolation();
2971+
auto existingIso = ace->getClosureActorIsolation();
29722972
if (existingIso != ClosureActorIsolation()) {
29732973
assert(false && "somebody set the closure's isolation already?");
29742974
return existingIso;

0 commit comments

Comments
 (0)