mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ownership] Add support for cloning unmanaged_{retain,release}_value from ossa => non-ossa code.
Just an oversight on my part. I double checked that the only remaining difference is in how we handle checked_cast_br and switch_enum. I have a separate patch that fixes that.
This commit is contained in:
@@ -1610,6 +1610,13 @@ template <typename ImplClass>
|
||||
void SILCloner<ImplClass>::visitUnmanagedRetainValueInst(
|
||||
UnmanagedRetainValueInst *Inst) {
|
||||
getBuilder().setCurrentDebugScope(getOpScope(Inst->getDebugScope()));
|
||||
if (!getBuilder().hasOwnership()) {
|
||||
return recordClonedInstruction(
|
||||
Inst, getBuilder().createRetainValue(getOpLocation(Inst->getLoc()),
|
||||
getOpValue(Inst->getOperand()),
|
||||
Inst->getAtomicity()));
|
||||
}
|
||||
|
||||
recordClonedInstruction(Inst, getBuilder().createUnmanagedRetainValue(
|
||||
getOpLocation(Inst->getLoc()),
|
||||
getOpValue(Inst->getOperand()),
|
||||
@@ -1653,6 +1660,12 @@ template <typename ImplClass>
|
||||
void SILCloner<ImplClass>::visitUnmanagedReleaseValueInst(
|
||||
UnmanagedReleaseValueInst *Inst) {
|
||||
getBuilder().setCurrentDebugScope(getOpScope(Inst->getDebugScope()));
|
||||
if (!getBuilder().hasOwnership()) {
|
||||
return recordClonedInstruction(
|
||||
Inst, getBuilder().createReleaseValue(getOpLocation(Inst->getLoc()),
|
||||
getOpValue(Inst->getOperand()),
|
||||
Inst->getAtomicity()));
|
||||
}
|
||||
recordClonedInstruction(Inst, getBuilder().createUnmanagedReleaseValue(
|
||||
getOpLocation(Inst->getLoc()),
|
||||
getOpValue(Inst->getOperand()),
|
||||
|
||||
Reference in New Issue
Block a user