SIL: Give project_box a field index operand.

Allow project_box to get the address of any field in a multi-field box.
This commit is contained in:
Joe Groff
2016-10-21 16:01:06 -07:00
parent 374fa57530
commit e4c67e2d5a
62 changed files with 694 additions and 648 deletions

View File

@@ -802,7 +802,6 @@ bool SILDeserializer::readSILInstruction(
ONETYPE_ONEOPERAND_INST(ExistentialMetatype)
ONETYPE_ONEOPERAND_INST(AllocValueBuffer)
ONETYPE_ONEOPERAND_INST(ProjectValueBuffer)
ONETYPE_ONEOPERAND_INST(ProjectBox)
ONETYPE_ONEOPERAND_INST(ProjectExistentialBox)
ONETYPE_ONEOPERAND_INST(DeallocValueBuffer)
#undef ONETYPE_ONEOPERAND_INST
@@ -846,6 +845,17 @@ bool SILDeserializer::readSILInstruction(
ONEOPERAND_ONETYPE_INST(ProjectBlockStorage)
#undef ONEOPERAND_ONETYPE_INST
case ValueKind::ProjectBoxInst: {
assert(RecordKind == SIL_ONE_TYPE_ONE_OPERAND &&
"Layout should be OneTypeOneOperand.");
ResultVal = Builder.createProjectBox(Loc,
getLocalValue(ValID,
getSILType(MF->getType(TyID2),
(SILValueCategory)TyCategory2)),
TyID);
break;
}
case ValueKind::PointerToAddressInst: {
assert(RecordKind == SIL_ONE_TYPE_ONE_OPERAND &&
"Layout should be OneTypeOneOperand.");