@@ -3773,6 +3773,10 @@ namespace {
3773
3773
initialWritebackScope (std::move(writebackScope)),
3774
3774
expectedSiteCount(callee.getParameterListCount()) {}
3775
3775
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
+
3776
3780
// / Add a level of function application by passing in its possibly
3777
3781
// / unevaluated arguments and their formal type.
3778
3782
void addCallSite (CallSite &&site) {
@@ -4352,7 +4356,7 @@ RValue CallEmission::applyRemainingCallSites(RValue &&result,
4352
4356
return std::move (result);
4353
4357
}
4354
4358
4355
- static CallEmission prepareApplyExpr (SILGenFunction &SGF, Expr *e) {
4359
+ CallEmission CallEmission::forApplyExpr (SILGenFunction &SGF, Expr *e) {
4356
4360
// Set up writebacks for the call(s).
4357
4361
FormalEvaluationScope writebacks (SGF);
4358
4362
@@ -4387,7 +4391,7 @@ static CallEmission prepareApplyExpr(SILGenFunction &SGF, Expr *e) {
4387
4391
}
4388
4392
4389
4393
RValue SILGenFunction::emitApplyExpr (Expr *e, SGFContext c) {
4390
- CallEmission emission = prepareApplyExpr (*this , e);
4394
+ CallEmission emission = CallEmission::forApplyExpr (*this , e);
4391
4395
return emission.apply (c);
4392
4396
}
4393
4397
@@ -5275,7 +5279,7 @@ RValue SILGenFunction::emitApplyConversionFunction(SILLocation loc,
5275
5279
RValue &&operand) {
5276
5280
// Walk the function expression, which should produce a reference to the
5277
5281
// callee, leaving the final curry level unapplied.
5278
- CallEmission emission = prepareApplyExpr (*this , funcExpr);
5282
+ CallEmission emission = CallEmission::forApplyExpr (*this , funcExpr);
5279
5283
// Rewrite the operand type to the expected argument type, to handle tuple
5280
5284
// conversions etc.
5281
5285
auto funcTy = cast<FunctionType>(funcExpr->getType ()->getCanonicalType ());
0 commit comments