| ... | ... | @@ -7804,10 +7804,10 @@ pub const Metadata = enum(u32) { |
| 7804 | 7804 | pub const Subprogram = struct { |
| 7805 | 7805 | pub const Options = struct { |
| 7806 | 7806 | di_flags: DIFlags, |
| 7807 | | sp_flags: SPFlags, |
| 7807 | sp_flags: DISPFlags, |
| 7808 | 7808 | }; |
| 7809 | 7809 | |
| 7810 | | pub const SPFlags = packed struct(u32) { |
| 7810 | pub const DISPFlags = packed struct(u32) { |
| 7811 | 7811 | Virtuality: enum(u2) { Zero, Virtual, PureVirtual } = .Zero, |
| 7812 | 7812 | LocalToUnit: bool = false, |
| 7813 | 7813 | Definition: bool = false, |
| ... | ... | @@ -7822,21 +7822,21 @@ pub const Metadata = enum(u32) { |
| 7822 | 7822 | Unused: u20 = 0, |
| 7823 | 7823 | |
| 7824 | 7824 | pub fn format( |
| 7825 | | self: SPFlags, |
| 7825 | self: DISPFlags, |
| 7826 | 7826 | comptime _: []const u8, |
| 7827 | 7827 | _: std.fmt.FormatOptions, |
| 7828 | 7828 | writer: anytype, |
| 7829 | 7829 | ) @TypeOf(writer).Error!void { |
| 7830 | 7830 | var need_pipe = false; |
| 7831 | | inline for (@typeInfo(SPFlags).Struct.fields) |field| { |
| 7831 | inline for (@typeInfo(DISPFlags).Struct.fields) |field| { |
| 7832 | 7832 | switch (@typeInfo(field.type)) { |
| 7833 | 7833 | .Bool => if (@field(self, field.name)) { |
| 7834 | 7834 | if (need_pipe) try writer.writeAll(" | ") else need_pipe = true; |
| 7835 | | try writer.print("SPFlag{s}", .{field.name}); |
| 7835 | try writer.print("DISPFlag{s}", .{field.name}); |
| 7836 | 7836 | }, |
| 7837 | 7837 | .Enum => if (@field(self, field.name) != .Zero) { |
| 7838 | 7838 | if (need_pipe) try writer.writeAll(" | ") else need_pipe = true; |
| 7839 | | try writer.print("SPFlag{s}", .{@tagName(@field(self, field.name))}); |
| 7839 | try writer.print("DISPFlag{s}", .{@tagName(@field(self, field.name))}); |
| 7840 | 7840 | }, |
| 7841 | 7841 | .Int => assert(@field(self, field.name) == 0), |
| 7842 | 7842 | else => @compileError("bad field type: " ++ field.name ++ ": " ++ |
| ... | ... | @@ -8023,6 +8023,8 @@ pub const Metadata = enum(u32) { |
| 8023 | 8023 | bool: bool, |
| 8024 | 8024 | u32: u32, |
| 8025 | 8025 | u64: u64, |
| 8026 | di_flags: DIFlags, |
| 8027 | sp_flags: Subprogram.DISPFlags, |
| 8026 | 8028 | raw: []const u8, |
| 8027 | 8029 | |
| 8028 | 8030 | const ValueData = struct { |
| ... | ... | @@ -8094,7 +8096,12 @@ pub const Metadata = enum(u32) { |
| 8094 | 8096 | .string => |node| try writer.print((if (is_specialized) "" else "!") ++ "{}", .{ |
| 8095 | 8097 | node.fmt(builder), |
| 8096 | 8098 | }), |
| 8097 | | inline .bool, .u32, .u64 => |node| try writer.print("{}", .{node}), |
| 8099 | inline .bool, |
| 8100 | .u32, |
| 8101 | .u64, |
| 8102 | .di_flags, |
| 8103 | .sp_flags, |
| 8104 | => |node| try writer.print("{}", .{node}), |
| 8098 | 8105 | .raw => |node| try writer.writeAll(node), |
| 8099 | 8106 | } |
| 8100 | 8107 | } |
| ... | ... | @@ -8126,7 +8133,11 @@ pub const Metadata = enum(u32) { |
| 8126 | 8133 | }, |
| 8127 | 8134 | .EnumLiteral => .{ .raw = @tagName(some) }, |
| 8128 | 8135 | .Bool => .{ .bool = some }, |
| 8129 | | .Struct => .{ .u32 = @bitCast(some) }, |
| 8136 | .Struct => switch (Some) { |
| 8137 | DIFlags => .{ .di_flags = some }, |
| 8138 | Subprogram.DISPFlags => .{ .sp_flags = some }, |
| 8139 | else => @compileError("unknown type to format: " ++ @typeName(Node)), |
| 8140 | }, |
| 8130 | 8141 | .Int, .ComptimeInt => .{ .u64 = some }, |
| 8131 | 8142 | .Pointer => .{ .raw = some }, |
| 8132 | 8143 | else => @compileError("unknown type to format: " ++ @typeName(Node)), |
| ... | ... | @@ -9943,7 +9954,7 @@ pub fn printUnbuffered( |
| 9943 | 9954 | .virtualIndex = null, |
| 9944 | 9955 | .thisAdjustment = null, |
| 9945 | 9956 | .flags = extra.di_flags, |
| 9946 | | .spFlags = @as(Metadata.Subprogram.SPFlags, @bitCast(@as(u32, @as(u3, @intCast( |
| 9957 | .spFlags = @as(Metadata.Subprogram.DISPFlags, @bitCast(@as(u32, @as(u3, @intCast( |
| 9947 | 9958 | @intFromEnum(kind) - @intFromEnum(Metadata.Tag.subprogram), |
| 9948 | 9959 | ))) << 2)), |
| 9949 | 9960 | .unit = extra.compile_unit, |