@@ -1411,7 +1411,7 @@ class IRGenSILFunction :
1411
1411
void visitIsUniqueInst (IsUniqueInst *i);
1412
1412
void visitBeginCOWMutationInst (BeginCOWMutationInst *i);
1413
1413
void visitEndCOWMutationInst (EndCOWMutationInst *i);
1414
- void visitIsEscapingClosureInst (IsEscapingClosureInst *i);
1414
+ void visitDestroyNotEscapedClosureInst (DestroyNotEscapedClosureInst *i);
1415
1415
void visitDeallocStackInst (DeallocStackInst *i);
1416
1416
void visitDeallocStackRefInst (DeallocStackRefInst *i);
1417
1417
void visitDeallocPackInst (DeallocPackInst *i);
@@ -6335,8 +6335,8 @@ void IRGenSILFunction::visitEndCOWMutationInst(EndCOWMutationInst *i) {
6335
6335
setLoweredExplosion (i, v);
6336
6336
}
6337
6337
6338
- void IRGenSILFunction::visitIsEscapingClosureInst (
6339
- swift::IsEscapingClosureInst *i) {
6338
+ void IRGenSILFunction::visitDestroyNotEscapedClosureInst (
6339
+ swift::DestroyNotEscapedClosureInst *i) {
6340
6340
// The closure operand is allowed to be an optional closure.
6341
6341
auto operandType = i->getOperand ()->getType ();
6342
6342
if (operandType.getOptionalObjectType ())
@@ -6348,21 +6348,19 @@ void IRGenSILFunction::visitIsEscapingClosureInst(
6348
6348
6349
6349
// This code relies on that an optional<()->()>'s tag fits in the function
6350
6350
// pointer.
6351
- auto &TI = cast<LoadableTypeInfo >(getTypeInfo (operandType));
6351
+ auto &TI = cast<ReferenceTypeInfo >(getTypeInfo (operandType));
6352
6352
assert (TI.mayHaveExtraInhabitants (IGM) &&
6353
6353
" Must have extra inhabitants to be able to handle the optional "
6354
6354
" closure case" );
6355
6355
(void )TI;
6356
6356
6357
6357
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 ];
6362
6359
if (context->getType ()->isIntegerTy ())
6363
6360
context = Builder.CreateIntToPtr (context, IGM.RefCountedPtrTy );
6364
6361
auto result = emitIsEscapingClosureCall (context, i->getLoc ().getSourceLoc (),
6365
6362
i->getVerificationType ());
6363
+ TI.strongRelease (*this , closure, irgen::Atomicity::Atomic);
6366
6364
Explosion out;
6367
6365
out.add (result);
6368
6366
setLoweredExplosion (i, out);
0 commit comments