Skip to content

Commit 3a109a2

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. (cherry picked from commit 4b23564)
1 parent d70d8d8 commit 3a109a2

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
@@ -3948,7 +3948,9 @@ class AbstractClosureExpr : public DeclContext, public Expr {
39483948
/// returns nullptr if the closure doesn't have a body
39493949
BraceStmt *getBody() const;
39503950

3951-
ClosureActorIsolation getActorIsolation() const { return actorIsolation; }
3951+
ClosureActorIsolation getClosureActorIsolation() const {
3952+
return actorIsolation;
3953+
}
39523954

39533955
void setActorIsolation(ClosureActorIsolation actorIsolation) {
39543956
this->actorIsolation = actorIsolation;

lib/AST/ASTDumper.cpp

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

2595-
switch (auto isolation = E->getActorIsolation()) {
2595+
switch (auto isolation = E->getClosureActorIsolation()) {
25962596
case ClosureActorIsolation::Nonisolated:
25972597
break;
25982598

lib/AST/Decl.cpp

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

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

lib/AST/Expr.cpp

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

20152015
ClosureActorIsolation
20162016
swift::__AbstractClosureExpr_getActorIsolation(AbstractClosureExpr *CE) {
2017-
return CE->getActorIsolation();
2017+
return CE->getClosureActorIsolation();
20182018
}
20192019

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