mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add a copy_block_without_escaping %block withoutEscaping %closure instruction
Mandatory pass will clean it up and replace it by a copy_block and is_escaping/cond_fail/release combination on the %closure in follow-up patches. The instruction marks the dependence of a block on a closure that is used as an 'withoutActuallyEscaping' sentinel. rdar://39682865
This commit is contained in:
@@ -1312,13 +1312,18 @@ void SILSerializer::writeSILInstruction(const SILInstruction &SI) {
|
||||
|
||||
break;
|
||||
}
|
||||
case SILInstructionKind::CopyBlockWithoutEscapingInst:
|
||||
case SILInstructionKind::DeallocPartialRefInst:
|
||||
case SILInstructionKind::MarkDependenceInst:
|
||||
case SILInstructionKind::IndexAddrInst:
|
||||
case SILInstructionKind::IndexRawPointerInst: {
|
||||
SILValue operand, operand2;
|
||||
unsigned Attr = 0;
|
||||
if (SI.getKind() == SILInstructionKind::DeallocPartialRefInst) {
|
||||
if (SI.getKind() == SILInstructionKind::CopyBlockWithoutEscapingInst) {
|
||||
const CopyBlockWithoutEscapingInst *C = cast<CopyBlockWithoutEscapingInst>(&SI);
|
||||
operand = C->getBlock();
|
||||
operand2 = C->getClosure();
|
||||
} else if (SI.getKind() == SILInstructionKind::DeallocPartialRefInst) {
|
||||
const DeallocPartialRefInst *DPRI = cast<DeallocPartialRefInst>(&SI);
|
||||
operand = DPRI->getInstance();
|
||||
operand2 = DPRI->getMetatype();
|
||||
|
||||
Reference in New Issue
Block a user