| ... | ... | @@ -660,7 +660,7 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void { |
| 660 | 660 | .slice_elem_val => try self.airSliceElemVal(inst), |
| 661 | 661 | .slice_elem_ptr => @panic("TODO try self.airSliceElemPtr(inst)"), |
| 662 | 662 | .ptr_elem_val => @panic("TODO try self.airPtrElemVal(inst)"), |
| 663 | | .ptr_elem_ptr => @panic("TODO try self.airPtrElemPtr(inst)"), |
| 663 | .ptr_elem_ptr => try self.airPtrElemPtr(inst), |
| 664 | 664 | |
| 665 | 665 | .constant => unreachable, // excluded from function bodies |
| 666 | 666 | .const_ty => unreachable, // excluded from function bodies |
| ... | ... | @@ -1646,6 +1646,13 @@ fn airNot(self: *Self, inst: Air.Inst.Index) !void { |
| 1646 | 1646 | return self.finishAir(inst, result, .{ ty_op.operand, .none, .none }); |
| 1647 | 1647 | } |
| 1648 | 1648 | |
| 1649 | fn airPtrElemPtr(self: *Self, inst: Air.Inst.Index) !void { |
| 1650 | const ty_pl = self.air.instructions.items(.data)[inst].ty_pl; |
| 1651 | const extra = self.air.extraData(Air.Bin, ty_pl.payload).data; |
| 1652 | const result: MCValue = if (self.liveness.isUnused(inst)) .dead else return self.fail("TODO implement ptr_elem_ptr for {}", .{self.target.cpu.arch}); |
| 1653 | return self.finishAir(inst, result, .{ extra.lhs, extra.rhs, .none }); |
| 1654 | } |
| 1655 | |
| 1649 | 1656 | fn airRet(self: *Self, inst: Air.Inst.Index) !void { |
| 1650 | 1657 | const un_op = self.air.instructions.items(.data)[inst].un_op; |
| 1651 | 1658 | const operand = try self.resolveInst(un_op); |