authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-03-02 15:00:10-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-03-02 15:00:10-07:00
logc10a2d7649c4c73c0235cac64bdd3e98ff93b8c6
tree4775be5d4b6193e74db2f642fa5341c9a0fca22f
parent70d100b1e2997e9a8aaeb50840052b2571800a5a

stage2: use std.zig.fmtId for builtin.zig source


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

src/Compilation.zig+1-5
...@@ -2848,11 +2848,7 @@ pub fn generateBuiltinZigSource(comp: *Compilation, allocator: *Allocator) ![]u8...@@ -2848,11 +2848,7 @@ pub fn generateBuiltinZigSource(comp: *Compilation, allocator: *Allocator) ![]u8
2848 const index = @intCast(std.Target.Cpu.Feature.Set.Index, index_usize);2848 const index = @intCast(std.Target.Cpu.Feature.Set.Index, index_usize);
2849 const is_enabled = target.cpu.features.isEnabled(index);2849 const is_enabled = target.cpu.features.isEnabled(index);
2850 if (is_enabled) {2850 if (is_enabled) {
2851 // TODO some kind of "zig identifier escape" function rather than2851 try buffer.writer().print(" .{},\n", .{std.zig.fmtId(feature.name)});
2852 // unconditionally using @"" syntax
2853 try buffer.appendSlice(" .@\"");
2854 try buffer.appendSlice(feature.name);
2855 try buffer.appendSlice("\",\n");
2856 }2852 }
2857 }2853 }
28582854