SIL: Make drop_deinit a ForwardingInstruction.

drop_deinit forwards ownership while effectively stripping the deinitializer. It is similar to a type cast.

Fixes rdar://125590074 ([NonescapableTypes] Nonescapable types
cannot have deinits)
This commit is contained in:
Andrew Trick
2024-04-03 10:43:24 -07:00
parent bac1dc9699
commit 581010d00c
8 changed files with 102 additions and 8 deletions

View File

@@ -1885,6 +1885,10 @@ bool MarkDependenceInst::visitNonEscapingLifetimeEnds(
return !noUsers;
}
bool DestroyValueInst::isFullDeinitialization() {
return !isa<DropDeinitInst>(lookThroughOwnershipInsts(getOperand()));
}
PartialApplyInst *
DestroyValueInst::getNonescapingClosureAllocation() const {
SILValue operand = getOperand();