authorgravatar for xtex@astrafall.orgxtex <xtex@astrafall.org> 2026-09-30 19:53:39+08:00
committergravatar for xtex@astrafall.orgxtex <xtex@astrafall.org> 2026-09-30 19:57:14+08:00
log874c40e7474ddfcbc5e96094e7c91f6918d5a32e
tree81d3dca9665f38a2c9029c004ca1a8d5142b5f41
parentbbb48690de0d320e3a3d6436d28acfb8029f80c5
signature Signed by SSH key SHA256:IEYEjkZlkUTr5U9GiDAmZU/4eZus2t2RsxusyhQqwao

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")

1 files changed, 3 insertions(+), 5 deletions(-)

src/codegen/loongarch/Select.zig+3-5
......@@ -1308,7 +1308,7 @@ pub const Value = struct {
13081308 };
13091309
13101310 /// Materializes a value
1311 fn mat(vi: Value.Index, isel: *Select, opts: MatOptions) Mat.Error!Mat {
1311 fn mat(vi: Value.Index, isel: *Select, opts: MatOptions) codegen.Error!Mat {
13121312 // try vi.split(isel, true);
13131313 const mat_size = @min(opts.size, @as(u32, @intCast(vi.size(isel) - opts.offset)));
13141314 const loc_pref = if (opts.extension == .garbage)
......@@ -2046,8 +2046,6 @@ pub const Value = struct {
20462046 if (!std.debug.runtime_safety) assert(@sizeOf(Mat) <= 32);
20472047 }
20482048
2049 const Error = codegen.Error;
2050
20512049 pub fn ra(mat: Value.Mat) Register.Alias {
20522050 return mat.location.register;
20532051 }
......@@ -2066,7 +2064,7 @@ pub const Value = struct {
20662064 };
20672065 }
20682066
2069 fn finish(mat: Value.Mat, isel: *Select) Mat.Error!void {
2067 fn finish(mat: Value.Mat, isel: *Select) codegen.Error!void {
20702068 const vi = mat.vi;
20712069 const value = vi.get(isel);
20722070 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)
23152313 } else return isel.fail(format, args);
23162314}
23172315
2318fn moveDebugString(isel: *Select, reg: Register, msg: [:0]const u8) error{ OutOfMemory, AlreadyReported }!void {
2316fn moveDebugString(isel: *Select, reg: Register, msg: [:0]const u8) codegen.Error!void {
23192317 @branchHint(.cold);
23202318 assert(debug_trap_unimplemented_code);
23212319