File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -5480,6 +5480,28 @@ RValue RValueEmitter::visitMakeTemporarilyEscapableExpr(
5480
5480
visit (E->getNonescapingClosureValue ()).getAsSingleValue (SGF, E);
5481
5481
5482
5482
auto escapingFnTy = SGF.getLoweredType (E->getOpaqueValue ()->getType ());
5483
+ auto silFnTy = escapingFnTy.castTo <SILFunctionType>();
5484
+
5485
+ // Handle @convention(block). No withoutActuallyEscaping verification yet.
5486
+ if (silFnTy->getExtInfo ().getRepresentation () !=
5487
+ SILFunctionTypeRepresentation::Thick) {
5488
+ RValue rvalue;
5489
+ auto escapingClosure =
5490
+ SGF.emitManagedRValueWithCleanup (SGF.B .createConvertFunction (
5491
+ E, functionValue.ensurePlusOne (SGF, E).forward (SGF), escapingFnTy));
5492
+ // Bind the opaque value to the escaping function.
5493
+ SILGenFunction::OpaqueValueState opaqueValue{
5494
+ escapingClosure,
5495
+ /* consumable*/ true ,
5496
+ /* hasBeenConsumed*/ false ,
5497
+ };
5498
+ SILGenFunction::OpaqueValueRAII pushOpaqueValue (SGF, E->getOpaqueValue (),
5499
+ opaqueValue);
5500
+
5501
+ // Emit the guarded expression.
5502
+ rvalue = visit (E->getSubExpr (), C);
5503
+ return rvalue;
5504
+ }
5483
5505
5484
5506
// Convert it to an escaping function value.
5485
5507
auto escapingClosure =
You can’t perform that action at this time.
0 commit comments