Skip to content

Commit cd5485e

Browse files
xedinktoso
authored andcommitted
[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 c587584 commit cd5485e

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
@@ -1122,7 +1122,7 @@ class SILGenApply : public Lowering::ExprVisitor<SILGenApply> {
11221122
SILDeclRef constant = SILDeclRef(e->getDecl());
11231123

11241124
/// Some special handling may be necessary for thunks:
1125-
if (callSite && callSite->shouldApplyDistributedThunk()) {
1125+
if (callSite && callSite->usesDistributedThunk()) {
11261126
constant = SILDeclRef(e->getDecl()).asDistributed();
11271127
} else if (afd->isBackDeployed()) {
11281128
// 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
}
@@ -7800,7 +7800,7 @@ Expr *ExprRewriter::finishApply(ApplyExpr *apply, Type openedType,
78007800
apply->setImplicitlyThrows(true);
78017801
if (!FD->hasAsync())
78027802
apply->setImplicitlyAsync(ImplicitActorHopTarget::forInstanceSelf());
7803-
apply->setShouldApplyDistributedThunk(true);
7803+
apply->setUsesDistributedThunk(true);
78047804
}
78057805

78067806
solution.setExprTypes(apply);

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1738,7 +1738,7 @@ namespace {
17381738
call->setImplicitlyThrows(false);
17391739
}
17401740
if (setDistributedThunk) {
1741-
call->setShouldApplyDistributedThunk(true);
1741+
call->setUsesDistributedThunk(true);
17421742
}
17431743
return;
17441744
}

0 commit comments

Comments
 (0)