Skip to content

Commit 5a8acc9

Browse files
xdBronchalexrp
authored andcommitted
fix some llvm ir printer bugs
1 parent e8a4e47 commit 5a8acc9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/std/zig/llvm/Builder.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2037,7 +2037,7 @@ pub const Alignment = enum(u6) {
20372037

20382038
pub fn format(p: Prefixed, w: *Writer) Writer.Error!void {
20392039
const byte_units = p.alignment.toByteUnits() orelse return;
2040-
return w.print("{s}align ({d})", .{ p.prefix, byte_units });
2040+
return w.print("{s}align {d}", .{ p.prefix, byte_units });
20412041
}
20422042
};
20432043

@@ -2384,7 +2384,7 @@ pub const Global = struct {
23842384
};
23852385
fn format(data: FormatData, w: *Writer) Writer.Error!void {
23862386
try w.print("@{f}", .{
2387-
data.global.unwrap(data.builder).name(data.builder).fmt(data.builder, null),
2387+
data.global.unwrap(data.builder).name(data.builder).fmt(data.builder, .quote_unless_valid_identifier),
23882388
});
23892389
}
23902390
pub fn fmt(self: Index, builder: *const Builder) std.fmt.Formatter(FormatData, format) {
@@ -8401,7 +8401,7 @@ pub const Metadata = enum(u32) {
84018401
}, w);
84028402
},
84038403
.string => |node| try w.print("{s}{f}", .{
8404-
@as([]const u8, if (is_specialized) "" else "!"), node.fmt(builder),
8404+
@as([]const u8, if (is_specialized) "!" else ""), node.fmt(builder),
84058405
}),
84068406
inline .bool, .u32, .u64 => |node| try w.print("{}", .{node}),
84078407
inline .di_flags, .sp_flags => |node| try w.print("{f}", .{node}),
@@ -9782,7 +9782,7 @@ pub fn print(self: *Builder, w: *Writer) (Writer.Error || Allocator.Error)!void
97829782
instruction_index.name(&function).fmt(self),
97839783
@tagName(tag),
97849784
extra.lhs.fmt(function_index, self, .{ .percent = true }),
9785-
extra.rhs.fmt(function_index, self, .{ .percent = true }),
9785+
extra.rhs.fmt(function_index, self, .{}),
97869786
});
97879787
},
97889788
.addrspacecast,

0 commit comments

Comments
 (0)