fix some llvm ir printer bugs
This commit is contained in:
committed by
Alex Rønne Petersen
parent
e8a4e47d38
commit
5a8acc9115
@@ -2037,7 +2037,7 @@ pub const Alignment = enum(u6) {
|
||||
|
||||
pub fn format(p: Prefixed, w: *Writer) Writer.Error!void {
|
||||
const byte_units = p.alignment.toByteUnits() orelse return;
|
||||
return w.print("{s}align ({d})", .{ p.prefix, byte_units });
|
||||
return w.print("{s}align {d}", .{ p.prefix, byte_units });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2384,7 +2384,7 @@ pub const Global = struct {
|
||||
};
|
||||
fn format(data: FormatData, w: *Writer) Writer.Error!void {
|
||||
try w.print("@{f}", .{
|
||||
data.global.unwrap(data.builder).name(data.builder).fmt(data.builder, null),
|
||||
data.global.unwrap(data.builder).name(data.builder).fmt(data.builder, .quote_unless_valid_identifier),
|
||||
});
|
||||
}
|
||||
pub fn fmt(self: Index, builder: *const Builder) std.fmt.Formatter(FormatData, format) {
|
||||
@@ -8401,7 +8401,7 @@ pub const Metadata = enum(u32) {
|
||||
}, w);
|
||||
},
|
||||
.string => |node| try w.print("{s}{f}", .{
|
||||
@as([]const u8, if (is_specialized) "" else "!"), node.fmt(builder),
|
||||
@as([]const u8, if (is_specialized) "!" else ""), node.fmt(builder),
|
||||
}),
|
||||
inline .bool, .u32, .u64 => |node| try w.print("{}", .{node}),
|
||||
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
|
||||
instruction_index.name(&function).fmt(self),
|
||||
@tagName(tag),
|
||||
extra.lhs.fmt(function_index, self, .{ .percent = true }),
|
||||
extra.rhs.fmt(function_index, self, .{ .percent = true }),
|
||||
extra.rhs.fmt(function_index, self, .{}),
|
||||
});
|
||||
},
|
||||
.addrspacecast,
|
||||
|
||||
Reference in New Issue
Block a user