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

This commit is contained in:
Andrew Kelley 2021-03-02 15:00:10 -07:00
parent 70d100b1e2
commit c10a2d7649

View File

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