@@ -650,18 +650,16 @@ static ManagedValue manageParam(SILGenFunction &gen,
650
650
llvm_unreachable (" bad parameter convention" );
651
651
}
652
652
653
- static void collectParams (SILGenFunction &gen,
654
- SILLocation loc,
655
- SmallVectorImpl<ManagedValue> ¶ms,
656
- bool allowPlusZero) {
653
+ void SILGenFunction::collectThunkParams (SILLocation loc,
654
+ SmallVectorImpl<ManagedValue> ¶ms,
655
+ bool allowPlusZero) {
657
656
auto paramTypes =
658
- gen. F .getLoweredFunctionType ()->getParametersWithoutIndirectResult ();
657
+ F.getLoweredFunctionType ()->getParametersWithoutIndirectResult ();
659
658
for (auto param : paramTypes) {
660
- auto paramTy = gen.F .mapTypeIntoContext (param.getSILType ());
661
- auto paramValue = new (gen.SGM .M ) SILArgument (gen.F .begin (),
662
- paramTy);
663
-
664
- params.push_back (manageParam (gen, loc, paramValue, param, allowPlusZero));
659
+ auto paramTy = F.mapTypeIntoContext (param.getSILType ());
660
+ auto paramValue = new (SGM.M ) SILArgument (F.begin (), paramTy);
661
+ auto paramMV = manageParam (*this , loc, paramValue, param, allowPlusZero);
662
+ params.push_back (paramMV);
665
663
}
666
664
}
667
665
@@ -1332,7 +1330,7 @@ static void buildThunkBody(SILGenFunction &gen, SILLocation loc,
1332
1330
SmallVector<ManagedValue, 8 > params;
1333
1331
// TODO: Could accept +0 arguments here when forwardFunctionArguments/
1334
1332
// emitApply can.
1335
- collectParams ( gen, loc, params, /* allowPlusZero*/ false );
1333
+ gen. collectThunkParams ( loc, params, /* allowPlusZero*/ false );
1336
1334
1337
1335
ManagedValue fnValue = params.pop_back_val ();
1338
1336
auto fnType = fnValue.getType ().castTo <SILFunctionType>();
@@ -1683,7 +1681,7 @@ SILGenFunction::emitVTableThunk(SILDeclRef derived,
1683
1681
}
1684
1682
1685
1683
SmallVector<ManagedValue, 8 > thunkArgs;
1686
- collectParams (* this , loc, thunkArgs, /* allowPlusZero*/ true );
1684
+ collectThunkParams ( loc, thunkArgs, /* allowPlusZero*/ true );
1687
1685
1688
1686
SmallVector<ManagedValue, 8 > substArgs;
1689
1687
// If the thunk and implementation share an indirect result type, use it
@@ -1826,7 +1824,7 @@ void SILGenFunction::emitProtocolWitness(ProtocolConformance *conformance,
1826
1824
SmallVector<ManagedValue, 8 > origParams;
1827
1825
// TODO: Should be able to accept +0 values here, once
1828
1826
// forwardFunctionArguments/emitApply are able to.
1829
- collectParams (* this , loc, origParams, /* allowPlusZero*/ false );
1827
+ collectThunkParams ( loc, origParams, /* allowPlusZero*/ false );
1830
1828
1831
1829
// Handle special abstraction differences in "self".
1832
1830
// If the witness is a free function, drop it completely.
0 commit comments