mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #8090 from shajrawi/ConsumptionKind_UnconditionalCheckedCastValue
Add consumption kind to UnconditionalCheckedCastValueInst
This commit is contained in:
@@ -1930,10 +1930,12 @@ bool SILDeserializer::readSILInstruction(SILFunction *Fn, SILBasicBlock *BB,
|
||||
break;
|
||||
}
|
||||
case ValueKind::UnconditionalCheckedCastValueInst: {
|
||||
CastConsumptionKind consumption = getCastConsumptionKind(Attr);
|
||||
SILValue Val = getLocalValue(
|
||||
ValID, getSILType(MF->getType(TyID2), (SILValueCategory)TyCategory2));
|
||||
SILType Ty = getSILType(MF->getType(TyID), (SILValueCategory)TyCategory);
|
||||
ResultVal = Builder.createUnconditionalCheckedCastValue(Loc, Val, Ty);
|
||||
ResultVal =
|
||||
Builder.createUnconditionalCheckedCastValue(Loc, consumption, Val, Ty);
|
||||
break;
|
||||
}
|
||||
case ValueKind::UnconditionalCheckedCastAddrInst:
|
||||
|
||||
@@ -1313,7 +1313,8 @@ void SILSerializer::writeSILInstruction(const SILInstruction &SI) {
|
||||
auto CI = cast<UnconditionalCheckedCastValueInst>(&SI);
|
||||
SILInstCastLayout::emitRecord(
|
||||
Out, ScratchRecord, SILAbbrCodes[SILInstCastLayout::Code],
|
||||
(unsigned)SI.getKind(), /*attr*/ 0,
|
||||
(unsigned)SI.getKind(),
|
||||
toStableCastConsumptionKind(CI->getConsumptionKind()),
|
||||
S.addTypeRef(CI->getType().getSwiftRValueType()),
|
||||
(unsigned)CI->getType().getCategory(),
|
||||
S.addTypeRef(CI->getOperand()->getType().getSwiftRValueType()),
|
||||
|
||||
Reference in New Issue
Block a user