@@ -487,8 +487,7 @@ void SILGenFunction::emitFunction(FuncDecl *fd) {
487
487
auto captureInfo = SGM.M .Types .getLoweredLocalCaptures (SILDeclRef (fd));
488
488
emitProlog (captureInfo, fd->getParameters (), fd->getImplicitSelfDecl (), fd,
489
489
fd->getResultInterfaceType (), fd->hasThrows (), fd->getThrowsLoc ());
490
- Type resultTy = fd->mapTypeIntoContext (fd->getResultInterfaceType ());
491
- prepareEpilog (resultTy, fd->hasThrows (), CleanupLocation (fd));
490
+ prepareEpilog (true , fd->hasThrows (), CleanupLocation (fd));
492
491
493
492
emitProfilerIncrement (fd->getBody ());
494
493
emitStmt (fd->getBody ());
@@ -506,8 +505,7 @@ void SILGenFunction::emitClosure(AbstractClosureExpr *ace) {
506
505
SILDeclRef (ace));
507
506
emitProlog (captureInfo, ace->getParameters (), /* selfParam=*/ nullptr ,
508
507
ace, resultIfaceTy, ace->isBodyThrowing (), ace->getLoc ());
509
- prepareEpilog (ace->getResultType (), ace->isBodyThrowing (),
510
- CleanupLocation (ace));
508
+ prepareEpilog (true , ace->isBodyThrowing (), CleanupLocation (ace));
511
509
emitProfilerIncrement (ace);
512
510
if (auto *ce = dyn_cast<ClosureExpr>(ace)) {
513
511
emitStmt (ce->getBody ());
@@ -773,7 +771,7 @@ void SILGenFunction::emitGeneratorFunction(SILDeclRef function, Expr *value,
773
771
dc, interfaceType, /* throws=*/ false , SourceLoc ());
774
772
if (EmitProfilerIncrement)
775
773
emitProfilerIncrement (value);
776
- prepareEpilog (value-> getType () , false , CleanupLocation::get (Loc));
774
+ prepareEpilog (true , false , CleanupLocation::get (Loc));
777
775
778
776
{
779
777
llvm::Optional<SILGenFunction::OpaqueValueRAII> opaqueValue;
@@ -806,21 +804,19 @@ void SILGenFunction::emitGeneratorFunction(SILDeclRef function, VarDecl *var) {
806
804
auto decl = function.getAbstractFunctionDecl ();
807
805
auto *dc = decl->getInnermostDeclContext ();
808
806
auto interfaceType = var->getValueInterfaceType ();
809
- auto varType = var->getType ();
810
807
811
808
// If this is the backing storage for a property with an attached
812
809
// wrapper that was initialized with '=', the stored property initializer
813
810
// will be in terms of the original property's type.
814
811
if (auto originalProperty = var->getOriginalWrappedProperty ()) {
815
812
if (originalProperty->isPropertyMemberwiseInitializedWithWrappedType ()) {
816
813
interfaceType = originalProperty->getValueInterfaceType ();
817
- varType = originalProperty->getType ();
818
814
}
819
815
}
820
816
821
817
emitProlog (/* paramList*/ nullptr , /* selfParam*/ nullptr , interfaceType, dc,
822
818
/* throws=*/ false , SourceLoc ());
823
- prepareEpilog (varType , false , CleanupLocation::get (loc));
819
+ prepareEpilog (true , false , CleanupLocation::get (loc));
824
820
825
821
auto pbd = var->getParentPatternBinding ();
826
822
const auto i = pbd->getPatternEntryIndexForVarDecl (var);
0 commit comments