@@ -3769,6 +3769,10 @@ namespace {
3769
3769
initialWritebackScope (std::move(writebackScope)),
3770
3770
expectedSiteCount(callee.getParameterListCount()) {}
3771
3771
3772
+ // / A factory method for decomposing the apply expr \p e into a call
3773
+ // / emission.
3774
+ static CallEmission forApplyExpr (SILGenFunction &SGF, Expr *e);
3775
+
3772
3776
// / Add a level of function application by passing in its possibly
3773
3777
// / unevaluated arguments and their formal type.
3774
3778
void addCallSite (CallSite &&site) {
@@ -4348,7 +4352,7 @@ RValue CallEmission::applyRemainingCallSites(RValue &&result,
4348
4352
return std::move (result);
4349
4353
}
4350
4354
4351
- static CallEmission prepareApplyExpr (SILGenFunction &SGF, Expr *e) {
4355
+ CallEmission CallEmission::forApplyExpr (SILGenFunction &SGF, Expr *e) {
4352
4356
// Set up writebacks for the call(s).
4353
4357
FormalEvaluationScope writebacks (SGF);
4354
4358
@@ -4383,7 +4387,7 @@ static CallEmission prepareApplyExpr(SILGenFunction &SGF, Expr *e) {
4383
4387
}
4384
4388
4385
4389
RValue SILGenFunction::emitApplyExpr (Expr *e, SGFContext c) {
4386
- CallEmission emission = prepareApplyExpr (*this , e);
4390
+ CallEmission emission = CallEmission::forApplyExpr (*this , e);
4387
4391
return emission.apply (c);
4388
4392
}
4389
4393
@@ -5271,7 +5275,7 @@ RValue SILGenFunction::emitApplyConversionFunction(SILLocation loc,
5271
5275
RValue &&operand) {
5272
5276
// Walk the function expression, which should produce a reference to the
5273
5277
// callee, leaving the final curry level unapplied.
5274
- CallEmission emission = prepareApplyExpr (*this , funcExpr);
5278
+ CallEmission emission = CallEmission::forApplyExpr (*this , funcExpr);
5275
5279
// Rewrite the operand type to the expected argument type, to handle tuple
5276
5280
// conversions etc.
5277
5281
auto funcTy = cast<FunctionType>(funcExpr->getType ()->getCanonicalType ());
0 commit comments