| ... | @@ -3053,6 +3053,9 @@ fn structFieldPtr(self: *Self, inst: Air.Inst.Index, operand: Air.Inst.Ref, inde | ... | @@ -3053,6 +3053,9 @@ fn structFieldPtr(self: *Self, inst: Air.Inst.Index, operand: Air.Inst.Ref, inde |
| 3053 | const mcv = try self.resolveInst(operand); | 3053 | const mcv = try self.resolveInst(operand); |
| 3054 | const ptr_ty = self.air.typeOf(operand); | 3054 | const ptr_ty = self.air.typeOf(operand); |
| 3055 | const struct_ty = ptr_ty.childType(); | 3055 | const struct_ty = ptr_ty.childType(); |
| | 3056 | if (struct_ty.zigTypeTag() == .Struct and struct_ty.containerLayout() == .Packed) { |
| | 3057 | return self.fail("TODO structFieldPtr implement packed structs", .{}); |
| | 3058 | } |
| 3056 | const struct_field_offset = @intCast(u32, struct_ty.structFieldOffset(index, self.target.*)); | 3059 | const struct_field_offset = @intCast(u32, struct_ty.structFieldOffset(index, self.target.*)); |
| 3057 | | 3060 | |
| 3058 | const dst_mcv: MCValue = result: { | 3061 | const dst_mcv: MCValue = result: { |
| ... | @@ -3116,6 +3119,9 @@ fn airStructFieldVal(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -3116,6 +3119,9 @@ fn airStructFieldVal(self: *Self, inst: Air.Inst.Index) !void { |
| 3116 | | 3119 | |
| 3117 | const mcv = try self.resolveInst(operand); | 3120 | const mcv = try self.resolveInst(operand); |
| 3118 | const struct_ty = self.air.typeOf(operand); | 3121 | const struct_ty = self.air.typeOf(operand); |
| | 3122 | if (struct_ty.zigTypeTag() == .Struct and struct_ty.containerLayout() == .Packed) { |
| | 3123 | return self.fail("TODO airStructFieldVal implement packed structs", .{}); |
| | 3124 | } |
| 3119 | const struct_field_offset = struct_ty.structFieldOffset(index, self.target.*); | 3125 | const struct_field_offset = struct_ty.structFieldOffset(index, self.target.*); |
| 3120 | const struct_field_ty = struct_ty.structFieldType(index); | 3126 | const struct_field_ty = struct_ty.structFieldType(index); |
| 3121 | | 3127 | |
| ... | @@ -6242,6 +6248,9 @@ fn airAggregateInit(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -6242,6 +6248,9 @@ fn airAggregateInit(self: *Self, inst: Air.Inst.Index) !void { |
| 6242 | if (self.liveness.isUnused(inst)) break :res MCValue.dead; | 6248 | if (self.liveness.isUnused(inst)) break :res MCValue.dead; |
| 6243 | switch (result_ty.zigTypeTag()) { | 6249 | switch (result_ty.zigTypeTag()) { |
| 6244 | .Struct => { | 6250 | .Struct => { |
| | 6251 | if (result_ty.containerLayout() == .Packed) { |
| | 6252 | return self.fail("TODO airAggregateInit implement packed structs", .{}); |
| | 6253 | } |
| 6245 | const stack_offset = @intCast(i32, try self.allocMem(inst, abi_size, abi_align)); | 6254 | const stack_offset = @intCast(i32, try self.allocMem(inst, abi_size, abi_align)); |
| 6246 | for (elements, 0..) |elem, elem_i| { | 6255 | for (elements, 0..) |elem, elem_i| { |
| 6247 | if (result_ty.structFieldValueComptime(elem_i) != null) continue; // comptime elem | 6256 | if (result_ty.structFieldValueComptime(elem_i) != null) continue; // comptime elem |