@@ -1411,7 +1411,7 @@ class IRGenSILFunction :
14111411 void visitIsUniqueInst (IsUniqueInst *i);
14121412 void visitBeginCOWMutationInst (BeginCOWMutationInst *i);
14131413 void visitEndCOWMutationInst (EndCOWMutationInst *i);
1414- void visitIsEscapingClosureInst (IsEscapingClosureInst *i);
1414+ void visitDestroyNotEscapedClosureInst (DestroyNotEscapedClosureInst *i);
14151415 void visitDeallocStackInst (DeallocStackInst *i);
14161416 void visitDeallocStackRefInst (DeallocStackRefInst *i);
14171417 void visitDeallocPackInst (DeallocPackInst *i);
@@ -6335,8 +6335,8 @@ void IRGenSILFunction::visitEndCOWMutationInst(EndCOWMutationInst *i) {
63356335 setLoweredExplosion (i, v);
63366336}
63376337
6338- void IRGenSILFunction::visitIsEscapingClosureInst (
6339- swift::IsEscapingClosureInst *i) {
6338+ void IRGenSILFunction::visitDestroyNotEscapedClosureInst (
6339+ swift::DestroyNotEscapedClosureInst *i) {
63406340 // The closure operand is allowed to be an optional closure.
63416341 auto operandType = i->getOperand ()->getType ();
63426342 if (operandType.getOptionalObjectType ())
@@ -6348,21 +6348,19 @@ void IRGenSILFunction::visitIsEscapingClosureInst(
63486348
63496349 // This code relies on that an optional<()->()>'s tag fits in the function
63506350 // pointer.
6351- auto &TI = cast<LoadableTypeInfo >(getTypeInfo (operandType));
6351+ auto &TI = cast<ReferenceTypeInfo >(getTypeInfo (operandType));
63526352 assert (TI.mayHaveExtraInhabitants (IGM) &&
63536353 " Must have extra inhabitants to be able to handle the optional "
63546354 " closure case" );
63556355 (void )TI;
63566356
63576357 Explosion closure = getLoweredExplosion (i->getOperand ());
6358- auto func = closure.claimNext ();
6359- (void )func;
6360- auto context = closure.claimNext ();
6361- assert (closure.empty ());
6358+ auto context = closure.getAll ()[1 ];
63626359 if (context->getType ()->isIntegerTy ())
63636360 context = Builder.CreateIntToPtr (context, IGM.RefCountedPtrTy );
63646361 auto result = emitIsEscapingClosureCall (context, i->getLoc ().getSourceLoc (),
63656362 i->getVerificationType ());
6363+ TI.strongRelease (*this , closure, irgen::Atomicity::Atomic);
63666364 Explosion out;
63676365 out.add (result);
63686366 setLoweredExplosion (i, out);
0 commit comments