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 {...@@ -1308,7 +1308,7 @@ pub const Value = struct {
1308 };1308 };
13091309
1310 /// Materializes a value1310 /// 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 {
1312 // try vi.split(isel, true);1312 // try vi.split(isel, true);
1313 const mat_size = @min(opts.size, @as(u32, @intCast(vi.size(isel) - opts.offset)));1313 const mat_size = @min(opts.size, @as(u32, @intCast(vi.size(isel) - opts.offset)));
1314 const loc_pref = if (opts.extension == .garbage)1314 const loc_pref = if (opts.extension == .garbage)
...@@ -2046,8 +2046,6 @@ pub const Value = struct {...@@ -2046,8 +2046,6 @@ pub const Value = struct {
2046 if (!std.debug.runtime_safety) assert(@sizeOf(Mat) <= 32);2046 if (!std.debug.runtime_safety) assert(@sizeOf(Mat) <= 32);
2047 }2047 }
20482048
2049 const Error = codegen.Error;
2050
2051 pub fn ra(mat: Value.Mat) Register.Alias {2049 pub fn ra(mat: Value.Mat) Register.Alias {
2052 return mat.location.register;2050 return mat.location.register;
2053 }2051 }
...@@ -2066,7 +2064,7 @@ pub const Value = struct {...@@ -2066,7 +2064,7 @@ pub const Value = struct {
2066 };2064 };
2067 }2065 }
20682066
2069 fn finish(mat: Value.Mat, isel: *Select) Mat.Error!void {2067 fn finish(mat: Value.Mat, isel: *Select) codegen.Error!void {
2070 const vi = mat.vi;2068 const vi = mat.vi;
2071 const value = vi.get(isel);2069 const value = vi.get(isel);
2072 tracking_log.debug("{f}[{d}..{d}] <- {f} (mat finish)", .{ vi, mat.offset, mat.offset + mat.size - 1, mat.loc() });2070 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)...@@ -2315,7 +2313,7 @@ fn failUnimplemented(isel: *Select, comptime format: []const u8, args: anytype)
2315 } else return isel.fail(format, args);2313 } else return isel.fail(format, args);
2316}2314}
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 {
2319 @branchHint(.cold);2317 @branchHint(.cold);
2320 assert(debug_trap_unimplemented_code);2318 assert(debug_trap_unimplemented_code);
23212319