Merge remote-tracking branch 'origin/main' into rebranch

This commit is contained in:
swift-ci
2024-04-12 13:37:42 -07:00
560 changed files with 9353 additions and 3953 deletions

View File

@@ -2345,12 +2345,13 @@ void SILSerializer::writeSILInstruction(const SILInstruction &SI) {
RTAI->getOperand());
break;
}
case SILInstructionKind::StructInst: {
case SILInstructionKind::StructInst:
case SILInstructionKind::BorrowedFromInst: {
// Format: a type followed by a list of typed values. A typed value is
// expressed by 4 IDs: TypeID, TypeCategory, ValueID, ValueResultNumber.
const StructInst *StrI = cast<StructInst>(&SI);
const auto *svi = cast<SingleValueInstruction>(&SI);
SmallVector<ValueID, 4> ListOfValues;
for (auto Elt : StrI->getElements()) {
for (auto Elt : svi->getOperandValues()) {
ListOfValues.push_back(S.addTypeRef(Elt->getType().getRawASTType()));
ListOfValues.push_back((unsigned)Elt->getType().getCategory());
ListOfValues.push_back(addValueRef(Elt));
@@ -2358,8 +2359,8 @@ void SILSerializer::writeSILInstruction(const SILInstruction &SI) {
SILOneTypeValuesLayout::emitRecord(
Out, ScratchRecord, SILAbbrCodes[SILOneTypeValuesLayout::Code],
(unsigned)SI.getKind(), S.addTypeRef(StrI->getType().getRawASTType()),
(unsigned)StrI->getType().getCategory(), ListOfValues);
(unsigned)SI.getKind(), S.addTypeRef(svi->getType().getRawASTType()),
(unsigned)svi->getType().getCategory(), ListOfValues);
break;
}
case SILInstructionKind::TupleElementAddrInst: