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

@@ -1773,7 +1773,7 @@ emitEnumElementDispatch(ArrayRef<RowToSpecialize> rows,
// If the payload is boxed, project it.
if (elt->isIndirect() || elt->getParentEnum()->isIndirect()) {
SILValue boxedValue = SGF.B.createProjectBox(loc, origCMV.getValue());
SILValue boxedValue = SGF.B.createProjectBox(loc, origCMV.getValue(), 0);
eltTL = &SGF.getTypeLowering(boxedValue->getType());
if (eltTL->isLoadable())
boxedValue = SGF.B.createLoad(loc, boxedValue);