From 874c40e7474ddfcbc5e96094e7c91f6918d5a32e Mon Sep 17 00:00:00 2001 From: xtex Date: Wed, 30 Sep 2026 19:53:39 +0800 Subject: [PATCH] loongarch: replace Mat.Error with codegen.Error Also fixes the compiler error related to error sets when debug_trap_unimplemented_code is true. Follow-up: 2375b0063da5 ("link: improve explicit error sets") --- src/codegen/loongarch/Select.zig | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/codegen/loongarch/Select.zig b/src/codegen/loongarch/Select.zig index 8ab2f7a9d2bd910ce8e57e4b4ed2f73a7ffb6bbd..b257192fc1b68c6ac09ce6b5bac05fcba979a31b 100644 --- a/src/codegen/loongarch/Select.zig +++ b/src/codegen/loongarch/Select.zig @@ -1308,7 +1308,7 @@ pub const Value = struct { }; /// Materializes a value - fn mat(vi: Value.Index, isel: *Select, opts: MatOptions) Mat.Error!Mat { + fn mat(vi: Value.Index, isel: *Select, opts: MatOptions) codegen.Error!Mat { // try vi.split(isel, true); const mat_size = @min(opts.size, @as(u32, @intCast(vi.size(isel) - opts.offset))); const loc_pref = if (opts.extension == .garbage) @@ -2046,8 +2046,6 @@ pub const Value = struct { if (!std.debug.runtime_safety) assert(@sizeOf(Mat) <= 32); } - const Error = codegen.Error; - pub fn ra(mat: Value.Mat) Register.Alias { return mat.location.register; } @@ -2066,7 +2064,7 @@ pub const Value = struct { }; } - fn finish(mat: Value.Mat, isel: *Select) Mat.Error!void { + fn finish(mat: Value.Mat, isel: *Select) codegen.Error!void { const vi = mat.vi; const value = vi.get(isel); tracking_log.debug("{f}[{d}..{d}] <- {f} (mat finish)", .{ vi, mat.offset, mat.offset + mat.size - 1, mat.loc() }); @@ -2315,7 +2313,7 @@ fn failUnimplemented(isel: *Select, comptime format: []const u8, args: anytype) } else return isel.fail(format, args); } -fn moveDebugString(isel: *Select, reg: Register, msg: [:0]const u8) error{ OutOfMemory, AlreadyReported }!void { +fn moveDebugString(isel: *Select, reg: Register, msg: [:0]const u8) codegen.Error!void { @branchHint(.cold); assert(debug_trap_unimplemented_code); -- 2.54.0