mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Swift SIL: replace the set_deallocating instruction with begin_dealloc_ref
Codegen is the same, but `begin_dealloc_ref` consumes the operand and produces a new SSA value. This cleanly splits the liferange to the region before and within the destructor of a class.
This commit is contained in:
@@ -1480,7 +1480,6 @@ void SILSerializer::writeSILInstruction(const SILInstruction &SI) {
|
||||
case SILInstructionKind::UnmanagedReleaseValueInst:
|
||||
case SILInstructionKind::AutoreleaseValueInst:
|
||||
case SILInstructionKind::UnmanagedAutoreleaseValueInst:
|
||||
case SILInstructionKind::SetDeallocatingInst:
|
||||
case SILInstructionKind::DeallocStackInst:
|
||||
case SILInstructionKind::DeallocStackRefInst:
|
||||
case SILInstructionKind::DeallocPackInst:
|
||||
@@ -1622,6 +1621,7 @@ void SILSerializer::writeSILInstruction(const SILInstruction &SI) {
|
||||
}
|
||||
case SILInstructionKind::CopyBlockWithoutEscapingInst:
|
||||
case SILInstructionKind::DeallocPartialRefInst:
|
||||
case SILInstructionKind::BeginDeallocRefInst:
|
||||
case SILInstructionKind::MarkDependenceInst:
|
||||
case SILInstructionKind::IndexAddrInst:
|
||||
case SILInstructionKind::IndexRawPointerInst: {
|
||||
@@ -1635,6 +1635,10 @@ void SILSerializer::writeSILInstruction(const SILInstruction &SI) {
|
||||
const DeallocPartialRefInst *DPRI = cast<DeallocPartialRefInst>(&SI);
|
||||
operand = DPRI->getInstance();
|
||||
operand2 = DPRI->getMetatype();
|
||||
} else if (SI.getKind() == SILInstructionKind::BeginDeallocRefInst) {
|
||||
const BeginDeallocRefInst *bdr = cast<BeginDeallocRefInst>(&SI);
|
||||
operand = bdr->getReference();
|
||||
operand2 = bdr->getAllocation();
|
||||
} else if (SI.getKind() == SILInstructionKind::IndexRawPointerInst) {
|
||||
const IndexRawPointerInst *IRP = cast<IndexRawPointerInst>(&SI);
|
||||
operand = IRP->getBase();
|
||||
|
||||
Reference in New Issue
Block a user