| ... | ... | @@ -1037,7 +1037,7 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void { |
| 1037 | 1037 | fn processDeath(self: *Self, inst: Air.Inst.Index) void { |
| 1038 | 1038 | const air_tags = self.air.instructions.items(.tag); |
| 1039 | 1039 | if (air_tags[inst] == .constant) return; // Constants are immortal. |
| 1040 | | log.debug("%{d} => {}", .{ inst, MCValue{ .dead = {} } }); |
| 1040 | log.debug("%{d} => {}", .{ inst, MCValue.dead }); |
| 1041 | 1041 | // When editing this function, note that the logic must synchronize with `reuseOperand`. |
| 1042 | 1042 | const prev_value = self.getResolvedInstValue(inst); |
| 1043 | 1043 | const branch = &self.branch_stack.items[self.branch_stack.items.len - 1]; |
| ... | ... | @@ -4729,7 +4729,7 @@ fn airBlock(self: *Self, inst: Air.Inst.Index) !void { |
| 4729 | 4729 | // break instruction will choose a MCValue for the block result and overwrite |
| 4730 | 4730 | // this field. Following break instructions will use that MCValue to put their |
| 4731 | 4731 | // block results. |
| 4732 | | .mcv = MCValue{ .none = {} }, |
| 4732 | .mcv = .none, |
| 4733 | 4733 | }); |
| 4734 | 4734 | defer self.blocks.getPtr(inst).?.relocs.deinit(self.gpa); |
| 4735 | 4735 | |
| ... | ... | @@ -5145,9 +5145,9 @@ fn airAsm(self: *Self, inst: Air.Inst.Index) !void { |
| 5145 | 5145 | const reg_name = output[2 .. output.len - 1]; |
| 5146 | 5146 | const reg = parseRegName(reg_name) orelse |
| 5147 | 5147 | return self.fail("unrecognized register: '{s}'", .{reg_name}); |
| 5148 | | break :result MCValue{ .register = reg }; |
| 5148 | break :result .{ .register = reg }; |
| 5149 | 5149 | } else { |
| 5150 | | break :result MCValue{ .none = {} }; |
| 5150 | break :result .none; |
| 5151 | 5151 | } |
| 5152 | 5152 | }; |
| 5153 | 5153 | |
| ... | ... | @@ -6289,7 +6289,7 @@ fn resolveInst(self: *Self, inst: Air.Inst.Ref) InnerError!MCValue { |
| 6289 | 6289 | if (ref_int < Air.Inst.Ref.typed_value_map.len) { |
| 6290 | 6290 | const tv = Air.Inst.Ref.typed_value_map[ref_int]; |
| 6291 | 6291 | if (!tv.ty.hasRuntimeBitsIgnoreComptime() and !tv.ty.isError()) { |
| 6292 | | return MCValue{ .none = {} }; |
| 6292 | return .none; |
| 6293 | 6293 | } |
| 6294 | 6294 | return self.genTypedValue(tv); |
| 6295 | 6295 | } |
| ... | ... | @@ -6297,7 +6297,7 @@ fn resolveInst(self: *Self, inst: Air.Inst.Ref) InnerError!MCValue { |
| 6297 | 6297 | // If the type has no codegen bits, no need to store it. |
| 6298 | 6298 | const inst_ty = self.air.typeOf(inst); |
| 6299 | 6299 | if (!inst_ty.hasRuntimeBitsIgnoreComptime() and !inst_ty.isError()) |
| 6300 | | return MCValue{ .none = {} }; |
| 6300 | return .none; |
| 6301 | 6301 | |
| 6302 | 6302 | const inst_index = @intCast(Air.Inst.Index, ref_int - Air.Inst.Ref.typed_value_map.len); |
| 6303 | 6303 | switch (self.air.instructions.items(.tag)[inst_index]) { |
| ... | ... | @@ -6406,7 +6406,7 @@ fn resolveCallingConventionValues(self: *Self, fn_ty: Type) !CallMCValues { |
| 6406 | 6406 | switch (cc) { |
| 6407 | 6407 | .Naked => { |
| 6408 | 6408 | assert(result.args.len == 0); |
| 6409 | | result.return_value = .{ .unreach = {} }; |
| 6409 | result.return_value = .unreach; |
| 6410 | 6410 | result.stack_byte_count = 0; |
| 6411 | 6411 | result.stack_align = 1; |
| 6412 | 6412 | return result; |
| ... | ... | @@ -6414,10 +6414,10 @@ fn resolveCallingConventionValues(self: *Self, fn_ty: Type) !CallMCValues { |
| 6414 | 6414 | .C => { |
| 6415 | 6415 | // Return values |
| 6416 | 6416 | if (ret_ty.zigTypeTag() == .NoReturn) { |
| 6417 | | result.return_value = .{ .unreach = {} }; |
| 6417 | result.return_value = .unreach; |
| 6418 | 6418 | } else if (!ret_ty.hasRuntimeBitsIgnoreComptime() and !ret_ty.isError()) { |
| 6419 | 6419 | // TODO: is this even possible for C calling convention? |
| 6420 | | result.return_value = .{ .none = {} }; |
| 6420 | result.return_value = .none; |
| 6421 | 6421 | } else { |
| 6422 | 6422 | const ret_ty_size = @intCast(u32, ret_ty.abiSize(self.target.*)); |
| 6423 | 6423 | if (ret_ty_size == 0) { |
| ... | ... | @@ -6489,9 +6489,9 @@ fn resolveCallingConventionValues(self: *Self, fn_ty: Type) !CallMCValues { |
| 6489 | 6489 | .Unspecified => { |
| 6490 | 6490 | // Return values |
| 6491 | 6491 | if (ret_ty.zigTypeTag() == .NoReturn) { |
| 6492 | | result.return_value = .{ .unreach = {} }; |
| 6492 | result.return_value = .unreach; |
| 6493 | 6493 | } else if (!ret_ty.hasRuntimeBitsIgnoreComptime() and !ret_ty.isError()) { |
| 6494 | | result.return_value = .{ .none = {} }; |
| 6494 | result.return_value = .none; |
| 6495 | 6495 | } else { |
| 6496 | 6496 | const ret_ty_size = @intCast(u32, ret_ty.abiSize(self.target.*)); |
| 6497 | 6497 | if (ret_ty_size == 0) { |
| ... | ... | @@ -6516,7 +6516,7 @@ fn resolveCallingConventionValues(self: *Self, fn_ty: Type) !CallMCValues { |
| 6516 | 6516 | |
| 6517 | 6517 | for (param_types, result.args) |ty, *arg| { |
| 6518 | 6518 | if (!ty.hasRuntimeBits()) { |
| 6519 | | arg.* = .{ .none = {} }; |
| 6519 | arg.* = .none; |
| 6520 | 6520 | continue; |
| 6521 | 6521 | } |
| 6522 | 6522 | const param_size = @intCast(u32, ty.abiSize(self.target.*)); |