Skip to content

Commit 706e3db

Browse files
authored
Merge pull request #14857 from gottesmm/pr-2b8da82466d75390465abccce3442cda2d85c5ca
2 parents 8d37165 + b6bffca commit 706e3db

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/SILGen/SILGenApply.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3773,6 +3773,10 @@ namespace {
37733773
initialWritebackScope(std::move(writebackScope)),
37743774
expectedSiteCount(callee.getParameterListCount()) {}
37753775

3776+
/// A factory method for decomposing the apply expr \p e into a call
3777+
/// emission.
3778+
static CallEmission forApplyExpr(SILGenFunction &SGF, Expr *e);
3779+
37763780
/// Add a level of function application by passing in its possibly
37773781
/// unevaluated arguments and their formal type.
37783782
void addCallSite(CallSite &&site) {
@@ -4352,7 +4356,7 @@ RValue CallEmission::applyRemainingCallSites(RValue &&result,
43524356
return std::move(result);
43534357
}
43544358

4355-
static CallEmission prepareApplyExpr(SILGenFunction &SGF, Expr *e) {
4359+
CallEmission CallEmission::forApplyExpr(SILGenFunction &SGF, Expr *e) {
43564360
// Set up writebacks for the call(s).
43574361
FormalEvaluationScope writebacks(SGF);
43584362

@@ -4387,7 +4391,7 @@ static CallEmission prepareApplyExpr(SILGenFunction &SGF, Expr *e) {
43874391
}
43884392

43894393
RValue SILGenFunction::emitApplyExpr(Expr *e, SGFContext c) {
4390-
CallEmission emission = prepareApplyExpr(*this, e);
4394+
CallEmission emission = CallEmission::forApplyExpr(*this, e);
43914395
return emission.apply(c);
43924396
}
43934397

@@ -5275,7 +5279,7 @@ RValue SILGenFunction::emitApplyConversionFunction(SILLocation loc,
52755279
RValue &&operand) {
52765280
// Walk the function expression, which should produce a reference to the
52775281
// callee, leaving the final curry level unapplied.
5278-
CallEmission emission = prepareApplyExpr(*this, funcExpr);
5282+
CallEmission emission = CallEmission::forApplyExpr(*this, funcExpr);
52795283
// Rewrite the operand type to the expected argument type, to handle tuple
52805284
// conversions etc.
52815285
auto funcTy = cast<FunctionType>(funcExpr->getType()->getCanonicalType());

0 commit comments

Comments
 (0)