[sil] Add support for cloning unmanaged_autorelease_value from ossa funcs into non-ossa funcs.

This commit is contained in:
Michael Gottesman
2019-02-01 13:24:55 -08:00
parent c12e556434
commit 647c63cdcc
2 changed files with 50 additions and 0 deletions

View File

@@ -1701,6 +1701,13 @@ template <typename ImplClass>
void SILCloner<ImplClass>::visitUnmanagedAutoreleaseValueInst(
UnmanagedAutoreleaseValueInst *Inst) {
getBuilder().setCurrentDebugScope(getOpScope(Inst->getDebugScope()));
if (!getBuilder().hasOwnership()) {
return recordClonedInstruction(Inst, getBuilder().createAutoreleaseValue(
getOpLocation(Inst->getLoc()),
getOpValue(Inst->getOperand()),
Inst->getAtomicity()));
}
recordClonedInstruction(Inst, getBuilder().createUnmanagedAutoreleaseValue(
getOpLocation(Inst->getLoc()),
getOpValue(Inst->getOperand()),