Skip to content

Commit 4fa74c2

Browse files
committed
[AST] ApplyExpr: Rename shouldApplyDistributedThunk to usesDistributedThunk
Since the thunk is applied to expression during solution application, the use of this flag has shifted towards stating the fact.
1 parent 0caf03d commit 4fa74c2

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

include/swift/AST/Expr.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ class alignas(8) Expr : public ASTAllocated<Expr> {
319319
ImplicitlyAsync : 1,
320320
ImplicitlyThrows : 1,
321321
NoAsync : 1,
322-
ShouldApplyDistributedThunk : 1
322+
UsesDistributedThunk : 1
323323
);
324324

325325
SWIFT_INLINE_BITFIELD_EMPTY(CallExpr, ApplyExpr);
@@ -4445,7 +4445,7 @@ class ApplyExpr : public Expr {
44454445
Bits.ApplyExpr.ImplicitlyAsync = false;
44464446
Bits.ApplyExpr.ImplicitlyThrows = false;
44474447
Bits.ApplyExpr.NoAsync = false;
4448-
Bits.ApplyExpr.ShouldApplyDistributedThunk = false;
4448+
Bits.ApplyExpr.UsesDistributedThunk = false;
44494449
}
44504450

44514451
public:
@@ -4532,11 +4532,11 @@ class ApplyExpr : public Expr {
45324532

45334533
/// Informs IRGen to that this expression should be applied as its distributed
45344534
/// thunk, rather than invoking the function directly.
4535-
bool shouldApplyDistributedThunk() const {
4536-
return Bits.ApplyExpr.ShouldApplyDistributedThunk;
4535+
bool usesDistributedThunk() const {
4536+
return Bits.ApplyExpr.UsesDistributedThunk;
45374537
}
4538-
void setShouldApplyDistributedThunk(bool flag) {
4539-
Bits.ApplyExpr.ShouldApplyDistributedThunk = flag;
4538+
void setUsesDistributedThunk(bool flag) {
4539+
Bits.ApplyExpr.UsesDistributedThunk = flag;
45404540
}
45414541

45424542
ValueDecl *getCalledValue() const;

lib/SILGen/SILGenApply.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,7 @@ class SILGenApply : public Lowering::ExprVisitor<SILGenApply> {
11251125
SILDeclRef constant = SILDeclRef(e->getDecl());
11261126

11271127
/// Some special handling may be necessary for thunks:
1128-
if (callSite && callSite->shouldApplyDistributedThunk()) {
1128+
if (callSite && callSite->usesDistributedThunk()) {
11291129
constant = SILDeclRef(e->getDecl()).asDistributed();
11301130
} else if (afd->isBackDeployed()) {
11311131
// If we're calling a back deployed function then we need to call a

lib/Sema/CSApply.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,7 +1670,7 @@ namespace {
16701670
if (isa<VarDecl>(decl)) {
16711671
auto *thunkCall = CallExpr::createImplicitEmpty(context, thunkApply);
16721672
thunkCall->setType(solution.simplifyType(openedType));
1673-
thunkCall->setShouldApplyDistributedThunk(true);
1673+
thunkCall->setUsesDistributedThunk(true);
16741674
cs.cacheType(thunkCall);
16751675
return thunkCall;
16761676
}
@@ -7797,7 +7797,7 @@ Expr *ExprRewriter::finishApply(ApplyExpr *apply, Type openedType,
77977797
apply->setImplicitlyThrows(true);
77987798
if (!FD->hasAsync())
77997799
apply->setImplicitlyAsync(ImplicitActorHopTarget::forInstanceSelf());
7800-
apply->setShouldApplyDistributedThunk(true);
7800+
apply->setUsesDistributedThunk(true);
78017801
}
78027802

78037803
solution.setExprTypes(apply);

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1779,7 +1779,7 @@ namespace {
17791779
call->setImplicitlyThrows(false);
17801780
}
17811781
if (setDistributedThunk) {
1782-
call->setShouldApplyDistributedThunk(true);
1782+
call->setUsesDistributedThunk(true);
17831783
}
17841784
return;
17851785
}

0 commit comments

Comments
 (0)