Skip to content

Commit 81a2157

Browse files
committed
Handle conversion of unchecked_value_cast to non-ossa in SILCloner
1 parent 010c1cd commit 81a2157

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/swift/SIL/SILCloner.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,6 +1542,13 @@ template <typename ImplClass>
15421542
void SILCloner<ImplClass>::visitUncheckedValueCastInst(
15431543
UncheckedValueCastInst *Inst) {
15441544
getBuilder().setCurrentDebugScope(getOpScope(Inst->getDebugScope()));
1545+
if (!getBuilder().hasOwnership()) {
1546+
recordClonedInstruction(Inst, getBuilder().createUncheckedBitwiseCast(
1547+
getOpLocation(Inst->getLoc()),
1548+
getOpValue(Inst->getOperand()),
1549+
getOpType(Inst->getType())));
1550+
return;
1551+
}
15451552
recordClonedInstruction(Inst, getBuilder().createUncheckedValueCast(
15461553
getOpLocation(Inst->getLoc()),
15471554
getOpValue(Inst->getOperand()),

0 commit comments

Comments
 (0)