authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-08-06 01:17:47-04:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-08-08 21:32:50-04:00
logf938404a45d347fe448351c70cc34db98700e068
treead2547066a9f8c8957e44133f58aa4a85710642f
parentd34201c8491007c5a24b4175a5170a5b6cc3d55e

Builder: fix attribute spacing


1 files changed, 15 insertions(+), 15 deletions(-)

src/codegen/llvm/Builder.zig+15-15
......@@ -1151,13 +1151,13 @@ pub const Attribute = union(Kind) {
11511151 .sret,
11521152 .elementtype,
11531153 => |ty| try writer.print(" {s}({%})", .{ @tagName(attribute), ty.fmt(data.builder) }),
1154 .@"align" => |alignment| try writer.print("{}", .{alignment}),
1154 .@"align" => |alignment| try writer.print("{ }", .{alignment}),
11551155 .dereferenceable,
11561156 .dereferenceable_or_null,
11571157 => |size| try writer.print(" {s}({d})", .{ @tagName(attribute), size }),
11581158 .nofpclass => |fpclass| {
11591159 const Int = @typeInfo(FpClass).Struct.backing_integer.?;
1160 try writer.print("{s}(", .{@tagName(attribute)});
1160 try writer.print(" {s}(", .{@tagName(attribute)});
11611161 var any = false;
11621162 var remaining: Int = @bitCast(fpclass);
11631163 inline for (@typeInfo(FpClass).Struct.decls) |decl| {
......@@ -1175,13 +1175,13 @@ pub const Attribute = union(Kind) {
11751175 },
11761176 .alignstack => |alignment| try writer.print(
11771177 if (comptime std.mem.indexOfScalar(u8, fmt_str, '#') != null)
1178 "{s}={d}"
1178 " {s}={d}"
11791179 else
1180 "{s}({d})",
1180 " {s}({d})",
11811181 .{ @tagName(attribute), alignment.toByteUnits() orelse return },
11821182 ),
11831183 .allockind => |allockind| {
1184 try writer.print("{s}(\"", .{@tagName(attribute)});
1184 try writer.print(" {s}(\"", .{@tagName(attribute)});
11851185 var any = false;
11861186 inline for (@typeInfo(AllocKind).Struct.fields) |field| {
11871187 if (comptime std.mem.eql(u8, field.name, "_")) continue;
......@@ -1196,22 +1196,22 @@ pub const Attribute = union(Kind) {
11961196 try writer.writeAll("\")");
11971197 },
11981198 .allocsize => |allocsize| {
1199 try writer.print("{s}({d}", .{ @tagName(attribute), allocsize.elem_size });
1199 try writer.print(" {s}({d}", .{ @tagName(attribute), allocsize.elem_size });
12001200 if (allocsize.num_elems != AllocSize.none)
12011201 try writer.print(",{d}", .{allocsize.num_elems});
12021202 try writer.writeByte(')');
12031203 },
1204 .memory => |memory| try writer.print("{s}({s}, argmem: {s}, inaccessiblemem: {s})", .{
1204 .memory => |memory| try writer.print(" {s}({s}, argmem: {s}, inaccessiblemem: {s})", .{
12051205 @tagName(attribute),
12061206 @tagName(memory.other),
12071207 @tagName(memory.argmem),
12081208 @tagName(memory.inaccessiblemem),
12091209 }),
12101210 .uwtable => |uwtable| if (uwtable != .none) {
1211 try writer.writeAll(@tagName(attribute));
1211 try writer.print(" {s}", .{@tagName(attribute)});
12121212 if (uwtable != UwTable.default) try writer.print("({s})", .{@tagName(uwtable)});
12131213 },
1214 .vscale_range => |vscale_range| try writer.print("{s}({d},{d})", .{
1214 .vscale_range => |vscale_range| try writer.print(" {s}({d},{d})", .{
12151215 @tagName(attribute),
12161216 vscale_range.min.toByteUnits().?,
12171217 vscale_range.max.toByteUnits() orelse 0,
......@@ -1867,7 +1867,7 @@ pub const AddrSpace = enum(u24) {
18671867 _: std.fmt.FormatOptions,
18681868 writer: anytype,
18691869 ) @TypeOf(writer).Error!void {
1870 if (self != .default) try writer.print("{s} addrspace({d})", .{ prefix, @intFromEnum(self) });
1870 if (self != .default) try writer.print("{s}addrspace({d})", .{ prefix, @intFromEnum(self) });
18711871 }
18721872};
18731873
......@@ -1908,7 +1908,7 @@ pub const Alignment = enum(u6) {
19081908 _: std.fmt.FormatOptions,
19091909 writer: anytype,
19101910 ) @TypeOf(writer).Error!void {
1911 try writer.print("{s} align {d}", .{ prefix, self.toByteUnits() orelse return });
1911 try writer.print("{s}align {d}", .{ prefix, self.toByteUnits() orelse return });
19121912 }
19131913};
19141914
......@@ -7413,7 +7413,7 @@ pub fn printUnbuffered(
74137413 if (variable.global.getReplacement(self) != .none) continue;
74147414 const global = variable.global.ptrConst(self);
74157415 try writer.print(
7416 \\{} ={}{}{}{}{}{}{}{} {s} {%}{ }{,}
7416 \\{} ={}{}{}{}{}{}{}{} {s} {%}{ }{, }
74177417 \\
74187418 , .{
74197419 variable.global.fmt(self),
......@@ -7612,7 +7612,7 @@ pub fn printUnbuffered(
76127612 => |tag| {
76137613 const extra =
76147614 function.extraData(Function.Instruction.Alloca, instruction.data);
7615 try writer.print(" %{} = {s} {%}{,%}{,}{,}\n", .{
7615 try writer.print(" %{} = {s} {%}{,%}{, }{, }\n", .{
76167616 instruction_index.name(&function).fmt(self),
76177617 @tagName(tag),
76187618 extra.type.fmt(self),
......@@ -7840,7 +7840,7 @@ pub fn printUnbuffered(
78407840 => |tag| {
78417841 const extra =
78427842 function.extraData(Function.Instruction.Load, instruction.data);
7843 try writer.print(" %{} = {s} {%}, {%}{}{}{,}\n", .{
7843 try writer.print(" %{} = {s} {%}, {%}{}{}{, }\n", .{
78447844 instruction_index.name(&function).fmt(self),
78457845 @tagName(tag),
78467846 extra.type.fmt(self),
......@@ -7908,7 +7908,7 @@ pub fn printUnbuffered(
79087908 => |tag| {
79097909 const extra =
79107910 function.extraData(Function.Instruction.Store, instruction.data);
7911 try writer.print(" {s} {%}, {%}{}{}{,}\n", .{
7911 try writer.print(" {s} {%}, {%}{}{}{, }\n", .{
79127912 @tagName(tag),
79137913 extra.val.fmt(function_index, self),
79147914 extra.ptr.fmt(function_index, self),