| ... | ... | @@ -1790,6 +1790,18 @@ pub const Linkage = enum(u4) { |
| 1790 | 1790 | ) @TypeOf(writer).Error!void { |
| 1791 | 1791 | if (self != .external) try writer.print(" {s}", .{@tagName(self)}); |
| 1792 | 1792 | } |
| 1793 | |
| 1794 | fn formatOptional( |
| 1795 | data: ?Linkage, |
| 1796 | comptime _: []const u8, |
| 1797 | _: std.fmt.FormatOptions, |
| 1798 | writer: anytype, |
| 1799 | ) @TypeOf(writer).Error!void { |
| 1800 | if (data) |linkage| try writer.print(" {s}", .{@tagName(linkage)}); |
| 1801 | } |
| 1802 | pub fn fmtOptional(self: ?Linkage) std.fmt.Formatter(formatOptional) { |
| 1803 | return .{ .data = self }; |
| 1804 | } |
| 1793 | 1805 | }; |
| 1794 | 1806 | |
| 1795 | 1807 | pub const Preemption = enum { |
| ... | ... | @@ -8073,10 +8085,9 @@ pub const Metadata = enum(u32) { |
| 8073 | 8085 | try format(.{ |
| 8074 | 8086 | .formatter = data.formatter, |
| 8075 | 8087 | .node = @unionInit(FormatData.Node, @tagName(tag)["local_".len..], node), |
| 8076 | | }, "", fmt_opts, writer); |
| 8088 | }, "%", fmt_opts, writer); |
| 8077 | 8089 | }, |
| 8078 | | .string => |node| try writer.print("{s}{}", .{ |
| 8079 | | if (is_specialized) "" else "!", |
| 8090 | .string => |node| try writer.print((if (is_specialized) "" else "!") ++ "{}", .{ |
| 8080 | 8091 | node.fmt(builder), |
| 8081 | 8092 | }), |
| 8082 | 8093 | inline .bool, .u32, .u64 => |node| try writer.print("{}", .{node}), |
| ... | ... | @@ -9276,7 +9287,8 @@ pub fn printUnbuffered( |
| 9276 | 9287 | \\ |
| 9277 | 9288 | , .{ |
| 9278 | 9289 | variable.global.fmt(self), |
| 9279 | | global.linkage, |
| 9290 | Linkage.fmtOptional(if (global.linkage == .external and |
| 9291 | variable.init != .no_init) null else global.linkage), |
| 9280 | 9292 | global.preemption, |
| 9281 | 9293 | global.visibility, |
| 9282 | 9294 | global.dll_storage_class, |