diff --git a/src/InternPool.zig b/src/InternPool.zig index cb4cddc96852761e753b7d1d7283da012a03c3db..37173377bee3c4146bfb0a6d30713b2d4bac95c4 100644 --- a/src/InternPool.zig +++ b/src/InternPool.zig @@ -12243,7 +12243,7 @@ const PackedCallingConvention = packed struct(u18) { std.builtin.CallingConvention.RiscvInterruptOptions => .{ .tag = tag, .incoming_stack_alignment = .fromByteUnits(pl.incoming_stack_alignment orelse 0), - .extra = @intFromEnum(pl.level), + .extra = @intFromEnum(pl.mode), }, else => comptime unreachable, }, @@ -12251,12 +12251,11 @@ const PackedCallingConvention = packed struct(u18) { } fn unpack(cc: PackedCallingConvention) std.builtin.CallingConvention { - @setEvalBranchQuota(400_000); return switch (cc.tag) { inline else => |tag| @unionInit( std.builtin.CallingConvention, @tagName(tag), - switch (std.meta.FieldType(std.builtin.CallingConvention, tag)) { + switch (@FieldType(std.builtin.CallingConvention, @tagName(tag))) { void => {}, std.builtin.CallingConvention.CommonOptions => .{ .incoming_stack_alignment = cc.incoming_stack_alignment.toByteUnits(), @@ -12275,7 +12274,7 @@ const PackedCallingConvention = packed struct(u18) { }, std.builtin.CallingConvention.RiscvInterruptOptions => .{ .incoming_stack_alignment = cc.incoming_stack_alignment.toByteUnits(), - .level = @enumFromInt(cc.extra), + .mode = @enumFromInt(cc.extra), }, else => comptime unreachable, }, diff --git a/src/Sema.zig b/src/Sema.zig index 7ff04ef9ea5b56022fc91ec9bbd3a37ee32b8c29..1957b94b5cd983fd48ef62765ed44db347b35345 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -31348,7 +31348,7 @@ fn callconvCoerceAllowed( if (src_data.mode != dest_data.mode) return false; }, std.builtin.CallingConvention.RiscvInterruptOptions => { - if (src_data.level != dest_data.level) return false; + if (src_data.mode != dest_data.mode) return false; }, else => comptime unreachable, } diff --git a/src/Value.zig b/src/Value.zig index 5fadb1a5c539cbf9a674d3a87de69e05c1dfc36d..6c5c01e2cc6e7d210250fef13dc88a505c782475 100644 --- a/src/Value.zig +++ b/src/Value.zig @@ -4495,8 +4495,6 @@ pub fn resolveLazy( /// This is useful for accessing `std.builtin` structures received from comptime logic. /// `val` must be fully resolved. pub fn interpret(val: Value, comptime T: type, pt: Zcu.PerThread) error{ OutOfMemory, UndefinedValue, TypeMismatch }!T { - @setEvalBranchQuota(400_000); - const zcu = pt.zcu; const ip = &zcu.intern_pool; const ty = val.typeOf(zcu); @@ -4552,13 +4550,13 @@ pub fn interpret(val: Value, comptime T: type, pt: Zcu.PerThread) error{ OutOfMe if (union_obj.field_types.len != @"union".fields.len) return error.TypeMismatch; const tag_val = val.unionTag(zcu) orelse return error.TypeMismatch; const tag = try tag_val.interpret(@"union".tag_type.?, pt); - switch (tag) { - inline else => |tag_comptime| { - const Payload = std.meta.FieldType(T, tag_comptime); - const payload = try val.unionValue(zcu).interpret(Payload, pt); - return @unionInit(T, @tagName(tag_comptime), payload); - }, - } + return switch (tag) { + inline else => |tag_comptime| @unionInit( + T, + @tagName(tag_comptime), + try val.unionValue(zcu).interpret(@FieldType(T, @tagName(tag_comptime)), pt), + ), + }; }, .@"struct" => |@"struct"| { @@ -4577,8 +4575,6 @@ pub fn interpret(val: Value, comptime T: type, pt: Zcu.PerThread) error{ OutOfMe /// within the compilation. This is useful for passing `std.builtin` structures in the compiler back to the compilation. /// This is the inverse of `interpret`. pub fn uninterpret(val: anytype, ty: Type, pt: Zcu.PerThread) error{ OutOfMemory, TypeMismatch }!Value { - @setEvalBranchQuota(400_000); - const T = @TypeOf(val); const zcu = pt.zcu;