authorgravatar for pentuppup@noreply.codeberg.orgpentuppup <pentuppup@noreply.codeberg.org> 2026-05-01 19:29:07-04:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-05-07 05:37:23+02:00
log6d98649f68cd369376020733a691db5c4324130a
tree6e10df389bc1d663bbbedd2bd8a783e8762e63b1
parente445c0d63e788fba46a41c1241e6b312423b7f21

llvm: print linksection when formatting IR


1 files changed, 12 insertions(+), 2 deletions(-)

lib/std/zig/llvm/Builder.zig+12-2
...@@ -9718,8 +9718,7 @@ pub fn print(self: *Builder, w: *Writer) (Writer.Error || Allocator.Error)!void...@@ -9718,8 +9718,7 @@ pub fn print(self: *Builder, w: *Writer) (Writer.Error || Allocator.Error)!void
9718 metadata_formatter.need_comma = true;9718 metadata_formatter.need_comma = true;
9719 defer metadata_formatter.need_comma = undefined;9719 defer metadata_formatter.need_comma = undefined;
9720 try w.print(9720 try w.print(
9721 \\{f} ={f}{f}{f}{f}{f}{f}{f}{f} {s} {f}{f}{f}{f}9721 \\{f} ={f}{f}{f}{f}{f}{f}{f}{f} {s} {f}{f}
9722 \\
9723 , .{9722 , .{
9724 variable.global.fmt(self),9723 variable.global.fmt(self),
9725 Linkage.fmtOptional(9724 Linkage.fmtOptional(
...@@ -9735,6 +9734,14 @@ pub fn print(self: *Builder, w: *Writer) (Writer.Error || Allocator.Error)!void...@@ -9735,6 +9734,14 @@ pub fn print(self: *Builder, w: *Writer) (Writer.Error || Allocator.Error)!void
9735 @tagName(variable.mutability),9734 @tagName(variable.mutability),
9736 global.type.fmt(self, .percent),9735 global.type.fmt(self, .percent),
9737 variable.init.fmt(self, .{ .space = true }),9736 variable.init.fmt(self, .{ .space = true }),
9737 });
9738 if (variable.section != .none) {
9739 try w.print(", section {f}", .{variable.section.fmtQ(self)});
9740 }
9741 try w.print(
9742 \\{f}{f}
9743 \\
9744 , .{
9738 variable.alignment.fmt(", "),9745 variable.alignment.fmt(", "),
9739 try metadata_formatter.fmt("!dbg ", global.dbg, null),9746 try metadata_formatter.fmt("!dbg ", global.dbg, null),
9740 });9747 });
...@@ -9828,6 +9835,9 @@ pub fn print(self: *Builder, w: *Writer) (Writer.Error || Allocator.Error)!void...@@ -9828,6 +9835,9 @@ pub fn print(self: *Builder, w: *Writer) (Writer.Error || Allocator.Error)!void
9828 {9835 {
9829 metadata_formatter.need_comma = false;9836 metadata_formatter.need_comma = false;
9830 defer metadata_formatter.need_comma = undefined;9837 defer metadata_formatter.need_comma = undefined;
9838 if (function.section != .none) {
9839 try w.print(" section {f}", .{function.section.fmtQ(self)});
9840 }
9831 try w.print("{f}{f}", .{9841 try w.print("{f}{f}", .{
9832 function.alignment.fmt(" "),9842 function.alignment.fmt(" "),
9833 try metadata_formatter.fmt(" !dbg ", global.dbg, null),9843 try metadata_formatter.fmt(" !dbg ", global.dbg, null),