@@ -4020,8 +4020,8 @@ void IRGenSILFunction::visitFullApplySite(FullApplySite site) {
4020
4020
Builder.emitBlock (typedErrorLoadBB);
4021
4021
4022
4022
auto &errorTI = cast<LoadableTypeInfo>(IGM.getTypeInfo (errorType));
4023
- auto silResultTy =
4024
- substConv.getSILResultType (IGM.getMaximalTypeExpansionContext ());
4023
+ auto silResultTy = CurSILFn-> mapTypeIntoContext (
4024
+ substConv.getSILResultType (IGM.getMaximalTypeExpansionContext ())) ;
4025
4025
auto &resultTI = cast<LoadableTypeInfo>(IGM.getTypeInfo (silResultTy));
4026
4026
4027
4027
auto &resultSchema = resultTI.nativeReturnValueSchema (IGM);
@@ -4498,8 +4498,8 @@ static void emitReturnInst(IRGenSILFunction &IGF,
4498
4498
SILType errorType;
4499
4499
if (fnType->hasErrorResult () && conv.isTypedError () &&
4500
4500
!conv.hasIndirectSILResults () && !conv.hasIndirectSILErrorResults ()) {
4501
- errorType =
4502
- conv.getSILErrorType (IGF.IGM .getMaximalTypeExpansionContext ());
4501
+ errorType = IGF. CurSILFn -> mapTypeIntoContext (
4502
+ conv.getSILErrorType (IGF.IGM .getMaximalTypeExpansionContext ())) ;
4503
4503
}
4504
4504
IGF.emitScalarReturn (resultTy, funcResultType, result, swiftCCReturn, false ,
4505
4505
mayPeepholeLoad, errorType);
@@ -4566,12 +4566,12 @@ void IRGenSILFunction::visitThrowInst(swift::ThrowInst *i) {
4566
4566
llvm::Constant *flag = llvm::ConstantInt::get (IGM.IntPtrTy , 1 );
4567
4567
flag = llvm::ConstantExpr::getIntToPtr (flag, IGM.Int8PtrTy );
4568
4568
Explosion errorResult = getLoweredExplosion (i->getOperand ());
4569
- auto silErrorTy =
4570
- conv.getSILErrorType (IGM.getMaximalTypeExpansionContext ());
4569
+ auto silErrorTy = CurSILFn-> mapTypeIntoContext (
4570
+ conv.getSILErrorType (IGM.getMaximalTypeExpansionContext ())) ;
4571
4571
auto &errorTI = cast<LoadableTypeInfo>(IGM.getTypeInfo (silErrorTy));
4572
4572
4573
- auto silResultTy =
4574
- conv.getSILResultType (IGM.getMaximalTypeExpansionContext ());
4573
+ auto silResultTy = CurSILFn-> mapTypeIntoContext (
4574
+ conv.getSILResultType (IGM.getMaximalTypeExpansionContext ())) ;
4575
4575
4576
4576
if (silErrorTy.getASTType ()->isNever ()) {
4577
4577
emitTrap (" Never can't be initialized" , true );
@@ -4621,12 +4621,12 @@ void IRGenSILFunction::visitThrowInst(swift::ThrowInst *i) {
4621
4621
conv.getSILResultType (IGM.getMaximalTypeExpansionContext ()));
4622
4622
4623
4623
if (conv.isTypedError ()) {
4624
- auto silErrorTy =
4625
- conv.getSILErrorType (IGM.getMaximalTypeExpansionContext ());
4624
+ auto silErrorTy = CurSILFn-> mapTypeIntoContext (
4625
+ conv.getSILErrorType (IGM.getMaximalTypeExpansionContext ())) ;
4626
4626
auto &errorTI = cast<LoadableTypeInfo>(IGM.getTypeInfo (silErrorTy));
4627
4627
4628
- auto silResultTy =
4629
- conv.getSILResultType (IGM.getMaximalTypeExpansionContext ());
4628
+ auto silResultTy = CurSILFn-> mapTypeIntoContext (
4629
+ conv.getSILResultType (IGM.getMaximalTypeExpansionContext ())) ;
4630
4630
auto &resultTI = cast<LoadableTypeInfo>(IGM.getTypeInfo (silResultTy));
4631
4631
auto &resultSchema = resultTI.nativeReturnValueSchema (IGM);
4632
4632
auto &errorSchema = errorTI.nativeReturnValueSchema (IGM);
0 commit comments