| ... | @@ -595,7 +595,7 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void { | ... | @@ -595,7 +595,7 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void { |
| 595 | .ret_load => try self.airRetLoad(inst), | 595 | .ret_load => try self.airRetLoad(inst), |
| 596 | .store => try self.airStore(inst, false), | 596 | .store => try self.airStore(inst, false), |
| 597 | .store_safe => try self.airStore(inst, true), | 597 | .store_safe => try self.airStore(inst, true), |
| 598 | .struct_field_ptr=> @panic("TODO try self.airStructFieldPtr(inst)"), | 598 | .struct_field_ptr=> try self.airStructFieldPtr(inst), |
| 599 | .struct_field_val=> try self.airStructFieldVal(inst), | 599 | .struct_field_val=> try self.airStructFieldVal(inst), |
| 600 | .array_to_slice => try self.airArrayToSlice(inst), | 600 | .array_to_slice => try self.airArrayToSlice(inst), |
| 601 | .int_to_float => try self.airIntToFloat(inst), | 601 | .int_to_float => try self.airIntToFloat(inst), |
| ... | @@ -2425,6 +2425,13 @@ fn airStore(self: *Self, inst: Air.Inst.Index, safety: bool) !void { | ... | @@ -2425,6 +2425,13 @@ fn airStore(self: *Self, inst: Air.Inst.Index, safety: bool) !void { |
| 2425 | return self.finishAir(inst, .dead, .{ bin_op.lhs, bin_op.rhs, .none }); | 2425 | return self.finishAir(inst, .dead, .{ bin_op.lhs, bin_op.rhs, .none }); |
| 2426 | } | 2426 | } |
| 2427 | | 2427 | |
| | 2428 | fn airStructFieldPtr(self: *Self, inst: Air.Inst.Index) !void { |
| | 2429 | const ty_pl = self.air.instructions.items(.data)[inst].ty_pl; |
| | 2430 | const extra = self.air.extraData(Air.StructField, ty_pl.payload).data; |
| | 2431 | const result = try self.structFieldPtr(inst, extra.struct_operand, extra.field_index); |
| | 2432 | return self.finishAir(inst, result, .{ extra.struct_operand, .none, .none }); |
| | 2433 | } |
| | 2434 | |
| 2428 | fn airStructFieldPtrIndex(self: *Self, inst: Air.Inst.Index, index: u8) !void { | 2435 | fn airStructFieldPtrIndex(self: *Self, inst: Air.Inst.Index, index: u8) !void { |
| 2429 | const ty_op = self.air.instructions.items(.data)[inst].ty_op; | 2436 | const ty_op = self.air.instructions.items(.data)[inst].ty_op; |
| 2430 | const result = try self.structFieldPtr(inst, ty_op.operand, index); | 2437 | const result = try self.structFieldPtr(inst, ty_op.operand, index); |