mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add support for unconditional checked cast instruction for opaque value types + SILGen support for it
This commit is contained in:
@@ -1301,6 +1301,18 @@ void SILSerializer::writeSILInstruction(const SILInstruction &SI) {
|
||||
llvm::makeArrayRef(listOfValues));
|
||||
break;
|
||||
}
|
||||
case ValueKind::UnconditionalCheckedCastOpaqueInst: {
|
||||
auto CI = cast<UnconditionalCheckedCastOpaqueInst>(&SI);
|
||||
SILInstCastLayout::emitRecord(
|
||||
Out, ScratchRecord, SILAbbrCodes[SILInstCastLayout::Code],
|
||||
(unsigned)SI.getKind(), /*attr*/ 0,
|
||||
S.addTypeRef(CI->getType().getSwiftRValueType()),
|
||||
(unsigned)CI->getType().getCategory(),
|
||||
S.addTypeRef(CI->getOperand()->getType().getSwiftRValueType()),
|
||||
(unsigned)CI->getOperand()->getType().getCategory(),
|
||||
addValueRef(CI->getOperand()));
|
||||
break;
|
||||
}
|
||||
case ValueKind::UncheckedRefCastAddrInst: {
|
||||
auto CI = cast<UncheckedRefCastAddrInst>(&SI);
|
||||
ValueID listOfValues[] = {
|
||||
|
||||
Reference in New Issue
Block a user