authorgravatar for codroid@gmail.comStevie Hryciw <codroid@gmail.com> 2022-11-14 20:44:31-08:00
committergravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2022-11-18 19:22:42+00:00
log04f3067a7921a51bd55870f3138220fd66426e33
tree158494e96381fe48304fef102d36a9431eef9642
parente999f9f472f6b57214a8a66b69b8928ad28acbfe

run zig fmt on everything checked by CI


40 files changed, 292 insertions(+), 293 deletions(-)

lib/std/c/freebsd.zig+4-4
......@@ -261,7 +261,7 @@ pub const Flock = extern struct {
261261 /// Lock owner.
262262 pid: pid_t,
263263 /// Lock type.
264 @"type": i16,
264 type: i16,
265265 /// Type of the start member.
266266 whence: i16,
267267 /// Remote system id or zero for local.
......@@ -438,7 +438,7 @@ pub const kinfo_file = extern struct {
438438 /// A zero value is for the sentinel record at the end of an array.
439439 structsize: c_int,
440440 /// Descriptor type.
441 @"type": c_int,
441 type: c_int,
442442 /// Array index.
443443 fd: fd_t,
444444 /// Reference count.
......@@ -456,7 +456,7 @@ pub const kinfo_file = extern struct {
456456 /// Socket domain.
457457 domain: c_int,
458458 /// Socket type.
459 @"type": c_int,
459 type: c_int,
460460 /// Socket protocol.
461461 protocol: c_int,
462462 /// Socket address.
......@@ -478,7 +478,7 @@ pub const kinfo_file = extern struct {
478478 },
479479 file: extern struct {
480480 /// Vnode type.
481 @"type": i32,
481 type: i32,
482482 // Reserved for future use
483483 _spare1: [3]i32,
484484 _spare2: [30]u64,
lib/std/c/solaris.zig+6-6
......@@ -24,20 +24,20 @@ pub const pthread_mutex_t = extern struct {
2424 flag1: u16 = 0,
2525 flag2: u8 = 0,
2626 ceiling: u8 = 0,
27 @"type": u16 = 0,
27 type: u16 = 0,
2828 magic: u16 = 0x4d58,
2929 lock: u64 = 0,
3030 data: u64 = 0,
3131};
3232pub const pthread_cond_t = extern struct {
3333 flag: [4]u8 = [_]u8{0} ** 4,
34 @"type": u16 = 0,
34 type: u16 = 0,
3535 magic: u16 = 0x4356,
3636 data: u64 = 0,
3737};
3838pub const pthread_rwlock_t = extern struct {
3939 readers: i32 = 0,
40 @"type": u16 = 0,
40 type: u16 = 0,
4141 magic: u16 = 0x5257,
4242 mutex: pthread_mutex_t = .{},
4343 readercv: pthread_cond_t = .{},
......@@ -50,7 +50,7 @@ pub const pthread_key_t = c_int;
5050
5151pub const sem_t = extern struct {
5252 count: u32 = 0,
53 @"type": u16 = 0,
53 type: u16 = 0,
5454 magic: u16 = 0x534d,
5555 __pad1: [3]u64 = [_]u64{0} ** 3,
5656 __pad2: [2]u64 = [_]u64{0} ** 2,
......@@ -1683,7 +1683,7 @@ pub const _SC = struct {
16831683pub const procfs = struct {
16841684 pub const misc_header = extern struct {
16851685 size: u32,
1686 @"type": enum(u32) {
1686 type: enum(u32) {
16871687 Pathname,
16881688 Socketname,
16891689 Peersockname,
......@@ -1851,7 +1851,7 @@ pub const lifreq = extern struct {
18511851 ppa: u32,
18521852 },
18531853 /// One of the IFT types, e.g. IFT_ETHER.
1854 @"type": u32,
1854 type: u32,
18551855 ifru: extern union {
18561856 /// Address.
18571857 addr: sockaddr.storage,
lib/std/coff.zig+4-4
......@@ -324,7 +324,7 @@ pub const BaseRelocation = packed struct {
324324 offset: u12,
325325
326326 /// Stored in the high 4 bits of the WORD, a value that indicates the type of base relocation to be applied.
327 @"type": BaseRelocationType,
327 type: BaseRelocationType,
328328};
329329
330330pub const BaseRelocationType = enum(u4) {
......@@ -393,7 +393,7 @@ pub const DebugDirectoryEntry = extern struct {
393393 time_date_stamp: u32,
394394 major_version: u16,
395395 minor_version: u16,
396 @"type": DebugType,
396 type: DebugType,
397397 size_of_data: u32,
398398 address_of_raw_data: u32,
399399 pointer_to_raw_data: u32,
......@@ -650,7 +650,7 @@ pub const Symbol = struct {
650650 name: [8]u8,
651651 value: u32,
652652 section_number: SectionNumber,
653 @"type": SymType,
653 type: SymType,
654654 storage_class: StorageClass,
655655 number_of_aux_symbols: u8,
656656
......@@ -1309,7 +1309,7 @@ pub const Symtab = struct {
13091309 .name = raw[0..8].*,
13101310 .value = mem.readIntLittle(u32, raw[8..12]),
13111311 .section_number = @intToEnum(SectionNumber, mem.readIntLittle(u16, raw[12..14])),
1312 .@"type" = @bitCast(SymType, mem.readIntLittle(u16, raw[14..16])),
1312 .type = @bitCast(SymType, mem.readIntLittle(u16, raw[14..16])),
13131313 .storage_class = @intToEnum(StorageClass, raw[16]),
13141314 .number_of_aux_symbols = raw[17],
13151315 };
lib/std/elf.zig+1-1
......@@ -835,7 +835,7 @@ pub const Elf32_RegInfo = extern struct {
835835pub const Elf_Options = extern struct {
836836 kind: u8,
837837 size: u8,
838 @"section": Elf32_Section,
838 section: Elf32_Section,
839839 info: Elf32_Word,
840840};
841841pub const Elf_Options_Hw = extern struct {
lib/std/fs/wasi.zig+7-7
......@@ -80,13 +80,13 @@ pub const Preopen = struct {
8080 fd: fd_t,
8181
8282 /// Type of the preopen.
83 @"type": PreopenType,
83 type: PreopenType,
8484
8585 /// Construct new `Preopen` instance.
8686 pub fn new(fd: fd_t, preopen_type: PreopenType) Preopen {
8787 return Preopen{
8888 .fd = fd,
89 .@"type" = preopen_type,
89 .type = preopen_type,
9090 };
9191 }
9292};
......@@ -125,7 +125,7 @@ pub const PreopenList = struct {
125125 /// Release all allocated memory.
126126 pub fn deinit(pm: Self) void {
127127 for (pm.buffer.items) |preopen| {
128 switch (preopen.@"type") {
128 switch (preopen.type) {
129129 PreopenType.Dir => |path| pm.buffer.allocator.free(path),
130130 }
131131 }
......@@ -161,7 +161,7 @@ pub const PreopenList = struct {
161161
162162 // Clear contents if we're being called again
163163 for (self.toOwnedSlice()) |preopen| {
164 switch (preopen.@"type") {
164 switch (preopen.type) {
165165 PreopenType.Dir => |path| self.buffer.allocator.free(path),
166166 }
167167 }
......@@ -226,7 +226,7 @@ pub const PreopenList = struct {
226226 var best_match: ?PreopenUri = null;
227227
228228 for (self.buffer.items) |preopen| {
229 if (preopen.@"type".getRelativePath(preopen_type)) |rel_path| {
229 if (preopen.type.getRelativePath(preopen_type)) |rel_path| {
230230 if (best_match == null or rel_path.len <= best_match.?.relative_path.len) {
231231 best_match = PreopenUri{
232232 .base = preopen,
......@@ -253,7 +253,7 @@ pub const PreopenList = struct {
253253 /// Otherwise, return `null`.
254254 pub fn find(self: Self, preopen_type: PreopenType) ?*const Preopen {
255255 for (self.buffer.items) |*preopen| {
256 if (preopen.@"type".eql(preopen_type)) {
256 if (preopen.type.eql(preopen_type)) {
257257 return preopen;
258258 }
259259 }
......@@ -280,7 +280,7 @@ test "extracting WASI preopens" {
280280 try preopens.populate(null);
281281
282282 const preopen = preopens.find(PreopenType{ .Dir = "." }) orelse unreachable;
283 try std.testing.expect(preopen.@"type".eql(PreopenType{ .Dir = "." }));
283 try std.testing.expect(preopen.type.eql(PreopenType{ .Dir = "." }));
284284
285285 const po_type1 = PreopenType{ .Dir = "/" };
286286 try std.testing.expect(std.mem.eql(u8, po_type1.getRelativePath(.{ .Dir = "/" }).?, ""));
lib/std/macho.zig+4-4
......@@ -700,7 +700,7 @@ pub const PROT = struct {
700700/// The format of the relocation entries referenced by the reloff and nreloc
701701/// fields of the section structure for mach object files is described in the
702702/// header file <reloc.h>.
703pub const @"section" = extern struct {
703pub const section = extern struct {
704704 /// name of this section
705705 sectname: [16]u8,
706706
......@@ -794,12 +794,12 @@ pub const section_64 = extern struct {
794794 }
795795
796796 pub fn isZerofill(sect: section_64) bool {
797 const tt = sect.@"type"();
797 const tt = sect.type();
798798 return tt == S_ZEROFILL or tt == S_GB_ZEROFILL or tt == S_THREAD_LOCAL_ZEROFILL;
799799 }
800800
801801 pub fn isSymbolStubs(sect: section_64) bool {
802 const tt = sect.@"type"();
802 const tt = sect.type();
803803 return tt == S_SYMBOL_STUBS;
804804 }
805805
......@@ -1804,7 +1804,7 @@ pub const CodeDirectory = extern struct {
18041804/// Structure of an embedded-signature SuperBlob
18051805pub const BlobIndex = extern struct {
18061806 /// Type of entry
1807 @"type": u32,
1807 type: u32,
18081808
18091809 /// Offset of entry
18101810 offset: u32,
lib/std/os/linux.zig+5-5
......@@ -3310,8 +3310,8 @@ pub const mmsghdr_const = extern struct {
33103310pub const epoll_data = extern union {
33113311 ptr: usize,
33123312 fd: i32,
3313 @"u32": u32,
3314 @"u64": u64,
3313 u32: u32,
3314 u64: u64,
33153315};
33163316
33173317pub const epoll_event = switch (builtin.zig_backend) {
......@@ -5124,7 +5124,7 @@ pub const nlmsghdr = extern struct {
51245124 len: u32,
51255125
51265126 /// Message content
5127 @"type": NetlinkMessageType,
5127 type: NetlinkMessageType,
51285128
51295129 /// Additional flags
51305130 flags: u16,
......@@ -5141,7 +5141,7 @@ pub const ifinfomsg = extern struct {
51415141 __pad1: u8 = 0,
51425142
51435143 /// ARPHRD_*
5144 @"type": c_ushort,
5144 type: c_ushort,
51455145
51465146 /// Link index
51475147 index: c_int,
......@@ -5158,7 +5158,7 @@ pub const rtattr = extern struct {
51585158 len: c_ushort,
51595159
51605160 /// Type of option
5161 @"type": IFLA,
5161 type: IFLA,
51625162
51635163 pub const ALIGNTO = 4;
51645164};
lib/std/os/linux/sparc64.zig+1-1
......@@ -435,7 +435,7 @@ pub const fpu_t = extern struct {
435435pub const mcontext_t = extern struct {
436436 gregs: gregset_t,
437437 fp: greg_t,
438 @"i7": greg_t,
438 i7: greg_t,
439439 fpregs: fpu_t,
440440};
441441
lib/std/os/wasi.zig+1-1
......@@ -279,7 +279,7 @@ pub const E = errno_t;
279279pub const event_t = extern struct {
280280 userdata: userdata_t,
281281 @"error": errno_t,
282 @"type": eventtype_t,
282 type: eventtype_t,
283283 fd_readwrite: eventfdreadwrite_t,
284284};
285285
lib/std/zig/system/linux.zig+11-11
......@@ -84,20 +84,20 @@ const PowerpcCpuinfoImpl = struct {
8484 .{ "7410", &Target.powerpc.cpu.@"7400" },
8585 .{ "7447", &Target.powerpc.cpu.@"7400" },
8686 .{ "7455", &Target.powerpc.cpu.@"7450" },
87 .{ "G4", &Target.powerpc.cpu.@"g4" },
87 .{ "G4", &Target.powerpc.cpu.g4 },
8888 .{ "POWER4", &Target.powerpc.cpu.@"970" },
8989 .{ "PPC970FX", &Target.powerpc.cpu.@"970" },
9090 .{ "PPC970MP", &Target.powerpc.cpu.@"970" },
91 .{ "G5", &Target.powerpc.cpu.@"g5" },
92 .{ "POWER5", &Target.powerpc.cpu.@"g5" },
93 .{ "A2", &Target.powerpc.cpu.@"a2" },
94 .{ "POWER6", &Target.powerpc.cpu.@"pwr6" },
95 .{ "POWER7", &Target.powerpc.cpu.@"pwr7" },
96 .{ "POWER8", &Target.powerpc.cpu.@"pwr8" },
97 .{ "POWER8E", &Target.powerpc.cpu.@"pwr8" },
98 .{ "POWER8NVL", &Target.powerpc.cpu.@"pwr8" },
99 .{ "POWER9", &Target.powerpc.cpu.@"pwr9" },
100 .{ "POWER10", &Target.powerpc.cpu.@"pwr10" },
91 .{ "G5", &Target.powerpc.cpu.g5 },
92 .{ "POWER5", &Target.powerpc.cpu.g5 },
93 .{ "A2", &Target.powerpc.cpu.a2 },
94 .{ "POWER6", &Target.powerpc.cpu.pwr6 },
95 .{ "POWER7", &Target.powerpc.cpu.pwr7 },
96 .{ "POWER8", &Target.powerpc.cpu.pwr8 },
97 .{ "POWER8E", &Target.powerpc.cpu.pwr8 },
98 .{ "POWER8NVL", &Target.powerpc.cpu.pwr8 },
99 .{ "POWER9", &Target.powerpc.cpu.pwr9 },
100 .{ "POWER10", &Target.powerpc.cpu.pwr10 },
101101 };
102102
103103 fn line_hook(self: *PowerpcCpuinfoImpl, key: []const u8, value: []const u8) !bool {
src/AstGen.zig+20-20
......@@ -2868,7 +2868,7 @@ fn deferStmt(
28682868 .name = ident_name,
28692869 .inst = remapped_err_code_ref,
28702870 .token_src = payload_token,
2871 .id_cat = .@"capture",
2871 .id_cat = .capture,
28722872 };
28732873 try gz.addDbgVar(.dbg_var_val, ident_name, remapped_err_code_ref);
28742874 break :blk &local_val_scope.base;
......@@ -5353,7 +5353,7 @@ fn orelseCatchExpr(
53535353 }
53545354 const err_name = try astgen.identAsString(payload);
53555355
5356 try astgen.detectLocalShadowing(scope, err_name, payload, err_str, .@"capture");
5356 try astgen.detectLocalShadowing(scope, err_name, payload, err_str, .capture);
53575357
53585358 err_val_scope = .{
53595359 .parent = &else_scope.base,
......@@ -5361,7 +5361,7 @@ fn orelseCatchExpr(
53615361 .name = err_name,
53625362 .inst = try else_scope.addUnNode(unwrap_code_op, operand, node),
53635363 .token_src = payload,
5364 .id_cat = .@"capture",
5364 .id_cat = .capture,
53655365 };
53665366 break :blk &err_val_scope.base;
53675367 };
......@@ -5698,14 +5698,14 @@ fn ifExpr(
56985698 const token_name_str = tree.tokenSlice(token_name_index);
56995699 if (mem.eql(u8, "_", token_name_str))
57005700 break :s &then_scope.base;
5701 try astgen.detectLocalShadowing(&then_scope.base, ident_name, token_name_index, token_name_str, .@"capture");
5701 try astgen.detectLocalShadowing(&then_scope.base, ident_name, token_name_index, token_name_str, .capture);
57025702 payload_val_scope = .{
57035703 .parent = &then_scope.base,
57045704 .gen_zir = &then_scope,
57055705 .name = ident_name,
57065706 .inst = payload_inst,
57075707 .token_src = payload_token,
5708 .id_cat = .@"capture",
5708 .id_cat = .capture,
57095709 };
57105710 try then_scope.addDbgVar(.dbg_var_val, ident_name, payload_inst);
57115711 break :s &payload_val_scope.base;
......@@ -5724,14 +5724,14 @@ fn ifExpr(
57245724 break :s &then_scope.base;
57255725 const payload_inst = try then_scope.addUnNode(tag, cond.inst, if_full.ast.then_expr);
57265726 const ident_name = try astgen.identAsString(ident_token);
5727 try astgen.detectLocalShadowing(&then_scope.base, ident_name, ident_token, ident_bytes, .@"capture");
5727 try astgen.detectLocalShadowing(&then_scope.base, ident_name, ident_token, ident_bytes, .capture);
57285728 payload_val_scope = .{
57295729 .parent = &then_scope.base,
57305730 .gen_zir = &then_scope,
57315731 .name = ident_name,
57325732 .inst = payload_inst,
57335733 .token_src = ident_token,
5734 .id_cat = .@"capture",
5734 .id_cat = .capture,
57355735 };
57365736 try then_scope.addDbgVar(.dbg_var_val, ident_name, payload_inst);
57375737 break :s &payload_val_scope.base;
......@@ -5775,14 +5775,14 @@ fn ifExpr(
57755775 const error_token_str = tree.tokenSlice(error_token);
57765776 if (mem.eql(u8, "_", error_token_str))
57775777 break :s &else_scope.base;
5778 try astgen.detectLocalShadowing(&else_scope.base, ident_name, error_token, error_token_str, .@"capture");
5778 try astgen.detectLocalShadowing(&else_scope.base, ident_name, error_token, error_token_str, .capture);
57795779 payload_val_scope = .{
57805780 .parent = &else_scope.base,
57815781 .gen_zir = &else_scope,
57825782 .name = ident_name,
57835783 .inst = payload_inst,
57845784 .token_src = error_token,
5785 .id_cat = .@"capture",
5785 .id_cat = .capture,
57865786 };
57875787 try else_scope.addDbgVar(.dbg_var_val, ident_name, payload_inst);
57885788 break :s &payload_val_scope.base;
......@@ -6045,14 +6045,14 @@ fn whileExpr(
60456045 break :s &then_scope.base;
60466046 const payload_name_loc = payload_token + @boolToInt(payload_is_ref);
60476047 const ident_name = try astgen.identAsString(payload_name_loc);
6048 try astgen.detectLocalShadowing(&then_scope.base, ident_name, payload_name_loc, ident_bytes, .@"capture");
6048 try astgen.detectLocalShadowing(&then_scope.base, ident_name, payload_name_loc, ident_bytes, .capture);
60496049 payload_val_scope = .{
60506050 .parent = &then_scope.base,
60516051 .gen_zir = &then_scope,
60526052 .name = ident_name,
60536053 .inst = indexToRef(payload_inst),
60546054 .token_src = payload_token,
6055 .id_cat = .@"capture",
6055 .id_cat = .capture,
60566056 };
60576057 dbg_var_name = ident_name;
60586058 dbg_var_inst = indexToRef(payload_inst);
......@@ -6073,14 +6073,14 @@ fn whileExpr(
60736073 const ident_bytes = tree.tokenSlice(ident_token);
60746074 if (mem.eql(u8, "_", ident_bytes))
60756075 break :s &then_scope.base;
6076 try astgen.detectLocalShadowing(&then_scope.base, ident_name, ident_token, ident_bytes, .@"capture");
6076 try astgen.detectLocalShadowing(&then_scope.base, ident_name, ident_token, ident_bytes, .capture);
60776077 payload_val_scope = .{
60786078 .parent = &then_scope.base,
60796079 .gen_zir = &then_scope,
60806080 .name = ident_name,
60816081 .inst = indexToRef(payload_inst),
60826082 .token_src = ident_token,
6083 .id_cat = .@"capture",
6083 .id_cat = .capture,
60846084 };
60856085 dbg_var_name = ident_name;
60866086 dbg_var_inst = indexToRef(payload_inst);
......@@ -6154,14 +6154,14 @@ fn whileExpr(
61546154 const ident_bytes = tree.tokenSlice(error_token);
61556155 if (mem.eql(u8, ident_bytes, "_"))
61566156 break :s &else_scope.base;
6157 try astgen.detectLocalShadowing(&else_scope.base, ident_name, error_token, ident_bytes, .@"capture");
6157 try astgen.detectLocalShadowing(&else_scope.base, ident_name, error_token, ident_bytes, .capture);
61586158 payload_val_scope = .{
61596159 .parent = &else_scope.base,
61606160 .gen_zir = &else_scope,
61616161 .name = ident_name,
61626162 .inst = else_payload_inst,
61636163 .token_src = error_token,
6164 .id_cat = .@"capture",
6164 .id_cat = .capture,
61656165 };
61666166 try else_scope.addDbgVar(.dbg_var_val, ident_name, else_payload_inst);
61676167 break :s &payload_val_scope.base;
......@@ -6326,14 +6326,14 @@ fn forExpr(
63266326 .lhs = array_ptr,
63276327 .rhs = index,
63286328 });
6329 try astgen.detectLocalShadowing(&then_scope.base, name_str_index, ident, value_name, .@"capture");
6329 try astgen.detectLocalShadowing(&then_scope.base, name_str_index, ident, value_name, .capture);
63306330 payload_val_scope = .{
63316331 .parent = &then_scope.base,
63326332 .gen_zir = &then_scope,
63336333 .name = name_str_index,
63346334 .inst = payload_inst,
63356335 .token_src = ident,
6336 .id_cat = .@"capture",
6336 .id_cat = .capture,
63376337 };
63386338 try then_scope.addDbgVar(.dbg_var_val, name_str_index, payload_inst);
63396339 payload_sub_scope = &payload_val_scope.base;
......@@ -6672,14 +6672,14 @@ fn switchExpr(
66726672 });
66736673 }
66746674 const capture_name = try astgen.identAsString(ident);
6675 try astgen.detectLocalShadowing(&case_scope.base, capture_name, ident, ident_slice, .@"capture");
6675 try astgen.detectLocalShadowing(&case_scope.base, capture_name, ident, ident_slice, .capture);
66766676 capture_val_scope = .{
66776677 .parent = &case_scope.base,
66786678 .gen_zir = &case_scope,
66796679 .name = capture_name,
66806680 .inst = indexToRef(capture_inst),
66816681 .token_src = payload_token,
6682 .id_cat = .@"capture",
6682 .id_cat = .capture,
66836683 };
66846684 dbg_var_name = capture_name;
66856685 dbg_var_inst = indexToRef(capture_inst);
......@@ -10453,7 +10453,7 @@ const Scope = struct {
1045310453 @"local variable",
1045410454 @"loop index capture",
1045510455 @"switch tag capture",
10456 @"capture",
10456 capture,
1045710457 };
1045810458
1045910459 /// This is always a `const` local and importantly the `inst` is a value type, not a pointer.
src/Autodoc.zig+4-4
......@@ -660,8 +660,8 @@ const DocData = struct {
660660 comptimeExpr: usize, // index in `comptimeExprs`
661661 void: struct {},
662662 @"unreachable": struct {},
663 @"null": struct {},
664 @"undefined": struct {},
663 null: struct {},
664 undefined: struct {},
665665 @"struct": []FieldVal,
666666 bool: bool,
667667 @"anytype": struct {},
......@@ -4217,7 +4217,7 @@ fn walkRef(
42174217 );
42184218 },
42194219 .undef => {
4220 return DocData.WalkResult{ .expr = .@"undefined" };
4220 return DocData.WalkResult{ .expr = .undefined };
42214221 },
42224222 .zero => {
42234223 return DocData.WalkResult{
......@@ -4245,7 +4245,7 @@ fn walkRef(
42454245 };
42464246 },
42474247 .null_value => {
4248 return DocData.WalkResult{ .expr = .@"null" };
4248 return DocData.WalkResult{ .expr = .null };
42494249 },
42504250 .bool_true => {
42514251 return DocData.WalkResult{
src/InternPool.zig+2-2
......@@ -168,9 +168,9 @@ pub const Simple = enum(u32) {
168168 null_type,
169169 undefined_type,
170170 enum_literal_type,
171 @"undefined",
171 undefined,
172172 void_value,
173 @"null",
173 null,
174174 bool_true,
175175 bool_false,
176176};
src/Sema.zig+51-51
......@@ -1716,7 +1716,7 @@ fn analyzeAsType(
17161716 src: LazySrcLoc,
17171717 air_inst: Air.Inst.Ref,
17181718) !Type {
1719 const wanted_type = Type.initTag(.@"type");
1719 const wanted_type = Type.initTag(.type);
17201720 const coerced_inst = try sema.coerce(block, wanted_type, air_inst, src);
17211721 const val = try sema.resolveConstValue(block, src, coerced_inst, "types must be comptime-known");
17221722 var buffer: Value.ToTypeBuffer = undefined;
......@@ -2396,9 +2396,9 @@ fn coerceResultPtr(
23962396 if (try sema.resolveDefinedValue(block, src, new_ptr)) |ptr_val| {
23972397 return sema.addConstant(ptr_ty, ptr_val);
23982398 }
2399 if (pointee_ty.eql(Type.@"null", sema.mod)) {
2399 if (pointee_ty.eql(Type.null, sema.mod)) {
24002400 const opt_ty = sema.typeOf(new_ptr).childType();
2401 const null_inst = try sema.addConstant(opt_ty, Value.@"null");
2401 const null_inst = try sema.addConstant(opt_ty, Value.null);
24022402 _ = try block.addBinOp(.store, new_ptr, null_inst);
24032403 return Air.Inst.Ref.void_value;
24042404 }
......@@ -2691,7 +2691,7 @@ fn zirEnumDecl(
26912691
26922692 enum_obj.* = .{
26932693 .owner_decl = new_decl_index,
2694 .tag_ty = Type.@"null",
2694 .tag_ty = Type.null,
26952695 .tag_ty_inferred = true,
26962696 .fields = .{},
26972697 .values = .{},
......@@ -2962,7 +2962,7 @@ fn zirUnionDecl(
29622962 errdefer mod.abortAnonDecl(new_decl_index);
29632963 union_obj.* = .{
29642964 .owner_decl = new_decl_index,
2965 .tag_ty = Type.initTag(.@"null"),
2965 .tag_ty = Type.initTag(.null),
29662966 .fields = .{},
29672967 .zir_index = inst,
29682968 .layout = small.layout,
......@@ -9885,7 +9885,7 @@ fn zirSwitchBlock(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError
98859885 .{},
98869886 );
98879887 }
9888 else_error_ty = Type.@"anyerror";
9888 else_error_ty = Type.anyerror;
98899889 } else else_validation: {
98909890 var maybe_msg: ?*Module.ErrorMsg = null;
98919891 errdefer if (maybe_msg) |msg| msg.destroy(sema.gpa);
......@@ -11558,7 +11558,7 @@ fn zirShl(
1155811558 })
1155911559 else
1156011560 ov_bit;
11561 const zero_ov = try sema.addConstant(Type.@"u1", Value.zero);
11561 const zero_ov = try sema.addConstant(Type.u1, Value.zero);
1156211562 const no_ov = try block.addBinOp(.cmp_eq, any_ov_bit, zero_ov);
1156311563
1156411564 try sema.addSafetyCheck(block, no_ov, .shl_overflow);
......@@ -13452,7 +13452,7 @@ fn zirOverflowArithmetic(
1345213452 const ov_ty = tuple_ty.tupleFields().types[1];
1345313453 // TODO: Remove and use `ov_ty` instead.
1345413454 // This is a temporary type used until overflow arithmetic properly returns `u1` instead of `bool`.
13455 const overflowed_ty = if (dest_ty.zigTypeTag() == .Vector) try Type.vector(sema.arena, dest_ty.vectorLen(), Type.@"bool") else Type.@"bool";
13455 const overflowed_ty = if (dest_ty.zigTypeTag() == .Vector) try Type.vector(sema.arena, dest_ty.vectorLen(), Type.bool) else Type.bool;
1345613456
1345713457 const result: struct {
1345813458 /// TODO: Rename to `overflow_bit` and make of type `u1`.
......@@ -13615,7 +13615,7 @@ fn zirOverflowArithmetic(
1361513615}
1361613616
1361713617fn overflowArithmeticTupleType(sema: *Sema, ty: Type) !Type {
13618 const ov_ty = if (ty.zigTypeTag() == .Vector) try Type.vector(sema.arena, ty.vectorLen(), Type.@"u1") else Type.@"u1";
13618 const ov_ty = if (ty.zigTypeTag() == .Vector) try Type.vector(sema.arena, ty.vectorLen(), Type.u1) else Type.u1;
1361913619
1362013620 const types = try sema.arena.alloc(Type, 2);
1362113621 const values = try sema.arena.alloc(Value, 2);
......@@ -14075,7 +14075,7 @@ fn analyzeArithmetic(
1407514075 })
1407614076 else
1407714077 ov_bit;
14078 const zero_ov = try sema.addConstant(Type.@"u1", Value.zero);
14078 const zero_ov = try sema.addConstant(Type.u1, Value.zero);
1407914079 const no_ov = try block.addBinOp(.cmp_eq, any_ov_bit, zero_ov);
1408014080
1408114081 try sema.addSafetyCheck(block, no_ov, .integer_overflow);
......@@ -14569,7 +14569,7 @@ fn cmpSelf(
1456914569 if (rhs_val.isUndef()) return sema.addConstUndef(Type.bool);
1457014570
1457114571 if (resolved_type.zigTypeTag() == .Vector) {
14572 const result_ty = try Type.vector(sema.arena, resolved_type.vectorLen(), Type.@"bool");
14572 const result_ty = try Type.vector(sema.arena, resolved_type.vectorLen(), Type.bool);
1457314573 const cmp_val = try sema.compareVector(lhs_val, op, rhs_val, resolved_type);
1457414574 return sema.addConstant(result_ty, cmp_val);
1457514575 }
......@@ -14600,7 +14600,7 @@ fn cmpSelf(
1460014600 };
1460114601 try sema.requireRuntimeBlock(block, src, runtime_src);
1460214602 if (resolved_type.zigTypeTag() == .Vector) {
14603 const result_ty = try Type.vector(sema.arena, resolved_type.vectorLen(), Type.@"bool");
14603 const result_ty = try Type.vector(sema.arena, resolved_type.vectorLen(), Type.bool);
1460414604 const result_ty_ref = try sema.addType(result_ty);
1460514605 return block.addCmpVector(casted_lhs, casted_rhs, op, result_ty_ref);
1460614606 }
......@@ -14932,63 +14932,63 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1493214932 type_info_ty,
1493314933 try Value.Tag.@"union".create(sema.arena, .{
1493414934 .tag = try Value.Tag.enum_field_index.create(sema.arena, @enumToInt(std.builtin.TypeId.Type)),
14935 .val = Value.@"void",
14935 .val = Value.void,
1493614936 }),
1493714937 ),
1493814938 .Void => return sema.addConstant(
1493914939 type_info_ty,
1494014940 try Value.Tag.@"union".create(sema.arena, .{
1494114941 .tag = try Value.Tag.enum_field_index.create(sema.arena, @enumToInt(std.builtin.TypeId.Void)),
14942 .val = Value.@"void",
14942 .val = Value.void,
1494314943 }),
1494414944 ),
1494514945 .Bool => return sema.addConstant(
1494614946 type_info_ty,
1494714947 try Value.Tag.@"union".create(sema.arena, .{
1494814948 .tag = try Value.Tag.enum_field_index.create(sema.arena, @enumToInt(std.builtin.TypeId.Bool)),
14949 .val = Value.@"void",
14949 .val = Value.void,
1495014950 }),
1495114951 ),
1495214952 .NoReturn => return sema.addConstant(
1495314953 type_info_ty,
1495414954 try Value.Tag.@"union".create(sema.arena, .{
1495514955 .tag = try Value.Tag.enum_field_index.create(sema.arena, @enumToInt(std.builtin.TypeId.NoReturn)),
14956 .val = Value.@"void",
14956 .val = Value.void,
1495714957 }),
1495814958 ),
1495914959 .ComptimeFloat => return sema.addConstant(
1496014960 type_info_ty,
1496114961 try Value.Tag.@"union".create(sema.arena, .{
1496214962 .tag = try Value.Tag.enum_field_index.create(sema.arena, @enumToInt(std.builtin.TypeId.ComptimeFloat)),
14963 .val = Value.@"void",
14963 .val = Value.void,
1496414964 }),
1496514965 ),
1496614966 .ComptimeInt => return sema.addConstant(
1496714967 type_info_ty,
1496814968 try Value.Tag.@"union".create(sema.arena, .{
1496914969 .tag = try Value.Tag.enum_field_index.create(sema.arena, @enumToInt(std.builtin.TypeId.ComptimeInt)),
14970 .val = Value.@"void",
14970 .val = Value.void,
1497114971 }),
1497214972 ),
1497314973 .Undefined => return sema.addConstant(
1497414974 type_info_ty,
1497514975 try Value.Tag.@"union".create(sema.arena, .{
1497614976 .tag = try Value.Tag.enum_field_index.create(sema.arena, @enumToInt(std.builtin.TypeId.Undefined)),
14977 .val = Value.@"void",
14977 .val = Value.void,
1497814978 }),
1497914979 ),
1498014980 .Null => return sema.addConstant(
1498114981 type_info_ty,
1498214982 try Value.Tag.@"union".create(sema.arena, .{
1498314983 .tag = try Value.Tag.enum_field_index.create(sema.arena, @enumToInt(std.builtin.TypeId.Null)),
14984 .val = Value.@"void",
14984 .val = Value.void,
1498514985 }),
1498614986 ),
1498714987 .EnumLiteral => return sema.addConstant(
1498814988 type_info_ty,
1498914989 try Value.Tag.@"union".create(sema.arena, .{
1499014990 .tag = try Value.Tag.enum_field_index.create(sema.arena, @enumToInt(std.builtin.TypeId.EnumLiteral)),
14991 .val = Value.@"void",
14991 .val = Value.void,
1499214992 }),
1499314993 ),
1499414994 .Fn => {
......@@ -15003,7 +15003,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1500315003 const param_ty = info.param_types[i];
1500415004 const is_generic = param_ty.tag() == .generic_poison;
1500515005 const param_ty_val = if (is_generic)
15006 Value.@"null"
15006 Value.null
1500715007 else
1500815008 try Value.Tag.opt_payload.create(
1500915009 params_anon_decl.arena(),
......@@ -15015,7 +15015,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1501515015 // is_generic: bool,
1501615016 Value.makeBool(is_generic),
1501715017 // is_noalias: bool,
15018 Value.@"false", // TODO
15018 Value.false, // TODO
1501915019 // arg_type: ?type,
1502015020 param_ty_val,
1502115021 };
......@@ -15068,7 +15068,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1506815068 try Value.Tag.ty.create(sema.arena, info.return_type),
1506915069 )
1507015070 else
15071 Value.@"null";
15071 Value.null;
1507215072
1507315073 const field_values = try sema.arena.create([6]Value);
1507415074 field_values.* = .{
......@@ -15287,7 +15287,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1528715287 .len = try Value.Tag.int_u64.create(sema.arena, vals.len),
1528815288 });
1528915289 break :v try Value.Tag.opt_payload.create(sema.arena, slice_val);
15290 } else Value.@"null";
15290 } else Value.null;
1529115291
1529215292 // Construct Type{ .ErrorSet = errors_val }
1529315293 return sema.addConstant(
......@@ -15498,7 +15498,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
1549815498 const enum_tag_ty_val = if (union_ty.unionTagType()) |tag_ty| v: {
1549915499 const ty_val = try Value.Tag.ty.create(sema.arena, tag_ty);
1550015500 break :v try Value.Tag.opt_payload.create(sema.arena, ty_val);
15501 } else Value.@"null";
15501 } else Value.null;
1550215502
1550315503 const field_values = try sema.arena.create([4]Value);
1550415504 field_values.* = .{
......@@ -15848,7 +15848,7 @@ fn zirLog2IntType(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError
1584815848
1584915849fn log2IntType(sema: *Sema, block: *Block, operand: Type, src: LazySrcLoc) CompileError!Type {
1585015850 switch (operand.zigTypeTag()) {
15851 .ComptimeInt => return Type.@"comptime_int",
15851 .ComptimeInt => return Type.comptime_int,
1585215852 .Int => {
1585315853 const bits = operand.bitSize(sema.mod.getTarget());
1585415854 const count = if (bits == 0)
......@@ -17518,7 +17518,7 @@ fn getErrorReturnTrace(sema: *Sema, block: *Block) CompileError!Air.Inst.Ref {
1751817518 {
1751917519 return block.addTy(.err_return_trace, opt_ptr_stack_trace_ty);
1752017520 }
17521 return sema.addConstant(opt_ptr_stack_trace_ty, Value.@"null");
17521 return sema.addConstant(opt_ptr_stack_trace_ty, Value.null);
1752217522}
1752317523
1752417524fn zirFrame(
......@@ -17760,11 +17760,11 @@ fn zirReify(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstData, in
1776017760
1776117761 const bits = @intCast(u16, bits_val.toUnsignedInt(target));
1776217762 const ty = switch (bits) {
17763 16 => Type.@"f16",
17764 32 => Type.@"f32",
17765 64 => Type.@"f64",
17766 80 => Type.@"f80",
17767 128 => Type.@"f128",
17763 16 => Type.f16,
17764 32 => Type.f32,
17765 64 => Type.f64,
17766 80 => Type.f80,
17767 128 => Type.f128,
1776817768 else => return sema.fail(block, src, "{}-bit float unsupported", .{bits}),
1776917769 };
1777017770 return sema.addType(ty);
......@@ -18029,7 +18029,7 @@ fn zirReify(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstData, in
1802918029
1803018030 enum_obj.* = .{
1803118031 .owner_decl = new_decl_index,
18032 .tag_ty = Type.@"null",
18032 .tag_ty = Type.null,
1803318033 .tag_ty_inferred = false,
1803418034 .fields = .{},
1803518035 .values = .{},
......@@ -18077,7 +18077,7 @@ fn zirReify(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstData, in
1807718077 // TODO: better source location
1807818078 return sema.fail(block, src, "field '{s}' with enumeration value '{}' is too large for backing int type '{}'", .{
1807918079 field_name,
18080 value_val.fmtValue(Type.@"comptime_int", mod),
18080 value_val.fmtValue(Type.comptime_int, mod),
1808118081 enum_obj.tag_ty.fmt(mod),
1808218082 });
1808318083 }
......@@ -18187,7 +18187,7 @@ fn zirReify(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstData, in
1818718187 errdefer mod.abortAnonDecl(new_decl_index);
1818818188 union_obj.* = .{
1818918189 .owner_decl = new_decl_index,
18190 .tag_ty = Type.initTag(.@"null"),
18190 .tag_ty = Type.initTag(.null),
1819118191 .fields = .{},
1819218192 .zir_index = inst,
1819318193 .layout = layout,
......@@ -19918,7 +19918,7 @@ fn zirCmpxchg(
1991819918
1991919919 // special case zero bit types
1992019920 if ((try sema.typeHasOnePossibleValue(elem_ty)) != null) {
19921 return sema.addConstant(result_ty, Value.@"null");
19921 return sema.addConstant(result_ty, Value.null);
1992219922 }
1992319923
1992419924 const runtime_src = if (try sema.resolveDefinedValue(block, ptr_src, ptr)) |ptr_val| rs: {
......@@ -19933,7 +19933,7 @@ fn zirCmpxchg(
1993319933 const stored_val = (try sema.pointerDeref(block, ptr_src, ptr_val, ptr_ty)) orelse break :rs ptr_src;
1993419934 const result_val = if (stored_val.eql(expected_val, elem_ty, sema.mod)) blk: {
1993519935 try sema.storePtr(block, src, ptr, new_value);
19936 break :blk Value.@"null";
19936 break :blk Value.null;
1993719937 } else try Value.Tag.opt_payload.create(sema.arena, stored_val);
1993819938
1993919939 return sema.addConstant(result_ty, result_val);
......@@ -20074,7 +20074,7 @@ fn zirShuffle(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air
2007420074 };
2007520075 mask_ty = try Type.Tag.vector.create(sema.arena, .{
2007620076 .len = mask_len,
20077 .elem_type = Type.@"i32",
20077 .elem_type = Type.i32,
2007820078 });
2007920079 mask = try sema.coerce(block, mask_ty, mask, mask_src);
2008020080 const mask_val = try sema.resolveConstMaybeUndefVal(block, mask_src, mask, "shuffle mask must be comptime-known");
......@@ -22133,7 +22133,7 @@ fn panicWithMsg(
2213322133 });
2213422134 const null_stack_trace = try sema.addConstant(
2213522135 try Type.optional(arena, ptr_stack_trace_ty),
22136 Value.@"null",
22136 Value.null,
2213722137 );
2213822138 const args: [3]Air.Inst.Ref = .{ msg_inst, null_stack_trace, .null_value };
2213922139 _ = try sema.analyzeCall(block, panic_fn, src, src, .auto, false, &args, null);
......@@ -23976,7 +23976,7 @@ fn coerceExtra(
2397623976
2397723977 // null to ?T
2397823978 if (inst_ty.zigTypeTag() == .Null) {
23979 return sema.addConstant(dest_ty, Value.@"null");
23979 return sema.addConstant(dest_ty, Value.null);
2398023980 }
2398123981
2398223982 // cast from ?*T and ?[*]T to ?*anyopaque
......@@ -24135,7 +24135,7 @@ fn coerceExtra(
2413524135 // coercion to C pointer
2413624136 .C => switch (inst_ty.zigTypeTag()) {
2413724137 .Null => {
24138 return sema.addConstant(dest_ty, Value.@"null");
24138 return sema.addConstant(dest_ty, Value.null);
2413924139 },
2414024140 .ComptimeInt => {
2414124141 const addr = sema.coerceExtra(block, Type.usize, inst, inst_src, .{ .report_err = false }) catch |err| switch (err) {
......@@ -27361,7 +27361,7 @@ fn refValue(sema: *Sema, block: *Block, ty: Type, val: Value) !Value {
2736127361}
2736227362
2736327363fn optRefValue(sema: *Sema, block: *Block, ty: Type, opt_val: ?Value) !Value {
27364 const val = opt_val orelse return Value.@"null";
27364 const val = opt_val orelse return Value.null;
2736527365 const ptr_val = try sema.refValue(block, ty, val);
2736627366 const result = try Value.Tag.opt_payload.create(sema.arena, ptr_val);
2736727367 return result;
......@@ -28301,7 +28301,7 @@ fn cmpVector(
2830128301 assert(rhs_ty.zigTypeTag() == .Vector);
2830228302 try sema.checkVectorizableBinaryOperands(block, src, lhs_ty, rhs_ty, lhs_src, rhs_src);
2830328303
28304 const result_ty = try Type.vector(sema.arena, lhs_ty.vectorLen(), Type.@"bool");
28304 const result_ty = try Type.vector(sema.arena, lhs_ty.vectorLen(), Type.bool);
2830528305
2830628306 const runtime_src: LazySrcLoc = src: {
2830728307 if (try sema.resolveMaybeUndefVal(lhs)) |lhs_val| {
......@@ -30419,7 +30419,7 @@ pub fn typeHasOnePossibleValue(sema: *Sema, ty: Type) CompileError!?Value {
3041930419 var buf: Type.Payload.ElemType = undefined;
3042030420 const child_ty = ty.optionalChild(&buf);
3042130421 if (child_ty.isNoReturn()) {
30422 return Value.@"null";
30422 return Value.null;
3042330423 } else {
3042430424 return null;
3042530425 }
......@@ -30539,8 +30539,8 @@ pub fn typeHasOnePossibleValue(sema: *Sema, ty: Type) CompileError!?Value {
3053930539 .empty_struct, .empty_struct_literal => return Value.initTag(.empty_struct_value),
3054030540 .void => return Value.void,
3054130541 .noreturn => return Value.initTag(.unreachable_value),
30542 .@"null" => return Value.@"null",
30543 .@"undefined" => return Value.initTag(.undef),
30542 .null => return Value.null,
30543 .undefined => return Value.initTag(.undef),
3054430544
3054530545 .int_unsigned, .int_signed => {
3054630546 if (ty.cast(Type.Payload.Bits).?.data == 0) {
......@@ -30712,8 +30712,8 @@ pub fn addType(sema: *Sema, ty: Type) !Air.Inst.Ref {
3071230712 .comptime_float => return .comptime_float_type,
3071330713 .noreturn => return .noreturn_type,
3071430714 .@"anyframe" => return .anyframe_type,
30715 .@"null" => return .null_type,
30716 .@"undefined" => return .undefined_type,
30715 .null => return .null_type,
30716 .undefined => return .undefined_type,
3071730717 .enum_literal => return .enum_literal_type,
3071830718 .atomic_order => return .atomic_order_type,
3071930719 .atomic_rmw_op => return .atomic_rmw_op_type,
......@@ -31102,8 +31102,8 @@ pub fn typeRequiresComptime(sema: *Sema, ty: Type) CompileError!bool {
3110231102 .anyerror,
3110331103 .noreturn,
3110431104 .@"anyframe",
31105 .@"null",
31106 .@"undefined",
31105 .null,
31106 .undefined,
3110731107 .atomic_order,
3110831108 .atomic_rmw_op,
3110931109 .calling_convention,
src/Zir.zig+2-2
......@@ -2367,7 +2367,7 @@ pub const Inst = struct {
23672367 },
23682368
23692369 .undef = .{
2370 .ty = Type.initTag(.@"undefined"),
2370 .ty = Type.initTag(.undefined),
23712371 .val = Value.initTag(.undef),
23722372 },
23732373 .zero = .{
......@@ -2395,7 +2395,7 @@ pub const Inst = struct {
23952395 .val = Value.initTag(.unreachable_value),
23962396 },
23972397 .null_value = .{
2398 .ty = Type.initTag(.@"null"),
2398 .ty = Type.initTag(.null),
23992399 .val = Value.initTag(.null_value),
24002400 },
24012401 .bool_true = .{
src/arch/aarch64/CodeGen.zig+12-12
......@@ -150,7 +150,7 @@ const MCValue = union(enum) {
150150 /// * got - the value is referenced indirectly via GOT entry index (the linker emits a got-type reloc)
151151 /// * direct - the value is referenced directly via symbol index index (the linker emits a displacement reloc)
152152 /// * import - the value is referenced indirectly via import entry index (the linker emits an import-type reloc)
153 linker_load: struct { @"type": enum { got, direct, import }, sym_index: u32 },
153 linker_load: struct { type: enum { got, direct, import }, sym_index: u32 },
154154 /// The value is one of the stack variables.
155155 ///
156156 /// If the type is a pointer, it means the pointer address is in
......@@ -4024,7 +4024,7 @@ fn store(self: *Self, ptr: MCValue, value: MCValue, ptr_ty: Type, value_ty: Type
40244024 },
40254025 .memory => |addr| try self.genSetReg(Type.usize, src_reg, .{ .immediate = @intCast(u32, addr) }),
40264026 .linker_load => |load_struct| {
4027 const tag: Mir.Inst.Tag = switch (load_struct.@"type") {
4027 const tag: Mir.Inst.Tag = switch (load_struct.type) {
40284028 .got => .load_memory_ptr_got,
40294029 .direct => .load_memory_ptr_direct,
40304030 .import => unreachable,
......@@ -4347,7 +4347,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallOptions.
43474347 const fn_owner_decl = mod.declPtr(func.owner_decl);
43484348 try self.genSetReg(Type.initTag(.u64), .x30, .{
43494349 .linker_load = .{
4350 .@"type" = .got,
4350 .type = .got,
43514351 .sym_index = fn_owner_decl.link.macho.sym_index,
43524352 },
43534353 });
......@@ -4385,7 +4385,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallOptions.
43854385 const fn_owner_decl = mod.declPtr(func.owner_decl);
43864386 try self.genSetReg(Type.initTag(.u64), .x30, .{
43874387 .linker_load = .{
4388 .@"type" = .got,
4388 .type = .got,
43894389 .sym_index = fn_owner_decl.link.coff.sym_index,
43904390 },
43914391 });
......@@ -4406,7 +4406,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallOptions.
44064406 const sym_index = try coff_file.getGlobalSymbol(mem.sliceTo(decl_name, 0));
44074407 try self.genSetReg(Type.initTag(.u64), .x30, .{
44084408 .linker_load = .{
4409 .@"type" = .import,
4409 .type = .import,
44104410 .sym_index = sym_index,
44114411 },
44124412 });
......@@ -5534,7 +5534,7 @@ fn genSetStack(self: *Self, ty: Type, stack_offset: u32, mcv: MCValue) InnerErro
55345534 },
55355535 .memory => |addr| try self.genSetReg(Type.usize, src_reg, .{ .immediate = addr }),
55365536 .linker_load => |load_struct| {
5537 const tag: Mir.Inst.Tag = switch (load_struct.@"type") {
5537 const tag: Mir.Inst.Tag = switch (load_struct.type) {
55385538 .got => .load_memory_ptr_got,
55395539 .direct => .load_memory_ptr_direct,
55405540 .import => unreachable,
......@@ -5648,7 +5648,7 @@ fn genSetReg(self: *Self, ty: Type, reg: Register, mcv: MCValue) InnerError!void
56485648 },
56495649 .register_with_overflow => unreachable, // doesn't fit into a register
56505650 .linker_load => |load_struct| {
5651 const tag: Mir.Inst.Tag = switch (load_struct.@"type") {
5651 const tag: Mir.Inst.Tag = switch (load_struct.type) {
56525652 .got => .load_memory_got,
56535653 .direct => .load_memory_direct,
56545654 .import => .load_memory_import,
......@@ -5842,7 +5842,7 @@ fn genSetStackArgument(self: *Self, ty: Type, stack_offset: u32, mcv: MCValue) I
58425842 },
58435843 .memory => |addr| try self.genSetReg(ptr_ty, src_reg, .{ .immediate = @intCast(u32, addr) }),
58445844 .linker_load => |load_struct| {
5845 const tag: Mir.Inst.Tag = switch (load_struct.@"type") {
5845 const tag: Mir.Inst.Tag = switch (load_struct.type) {
58465846 .got => .load_memory_ptr_got,
58475847 .direct => .load_memory_ptr_direct,
58485848 .import => unreachable,
......@@ -6168,7 +6168,7 @@ fn lowerDeclRef(self: *Self, tv: TypedValue, decl_index: Module.Decl.Index) Inne
61686168 // the linker has enough info to perform relocations.
61696169 assert(decl.link.macho.sym_index != 0);
61706170 return MCValue{ .linker_load = .{
6171 .@"type" = .got,
6171 .type = .got,
61726172 .sym_index = decl.link.macho.sym_index,
61736173 } };
61746174 } else if (self.bin_file.cast(link.File.Coff)) |_| {
......@@ -6176,7 +6176,7 @@ fn lowerDeclRef(self: *Self, tv: TypedValue, decl_index: Module.Decl.Index) Inne
61766176 // the linker has enough info to perform relocations.
61776177 assert(decl.link.coff.sym_index != 0);
61786178 return MCValue{ .linker_load = .{
6179 .@"type" = .got,
6179 .type = .got,
61806180 .sym_index = decl.link.coff.sym_index,
61816181 } };
61826182 } else if (self.bin_file.cast(link.File.Plan9)) |p9| {
......@@ -6198,12 +6198,12 @@ fn lowerUnnamedConst(self: *Self, tv: TypedValue) InnerError!MCValue {
61986198 return MCValue{ .memory = vaddr };
61996199 } else if (self.bin_file.cast(link.File.MachO)) |_| {
62006200 return MCValue{ .linker_load = .{
6201 .@"type" = .direct,
6201 .type = .direct,
62026202 .sym_index = local_sym_index,
62036203 } };
62046204 } else if (self.bin_file.cast(link.File.Coff)) |_| {
62056205 return MCValue{ .linker_load = .{
6206 .@"type" = .direct,
6206 .type = .direct,
62076207 .sym_index = local_sym_index,
62086208 } };
62096209 } else if (self.bin_file.cast(link.File.Plan9)) |_| {
src/arch/aarch64/Emit.zig+5-5
......@@ -687,7 +687,7 @@ fn mirCallExtern(emit: *Emit, inst: Mir.Inst.Index) !void {
687687 const atom = macho_file.getAtomForSymbol(.{ .sym_index = relocation.atom_index, .file = null }).?;
688688 const target = macho_file.getGlobalByIndex(relocation.sym_index);
689689 try atom.addRelocation(macho_file, .{
690 .@"type" = @enumToInt(std.macho.reloc_type_arm64.ARM64_RELOC_BRANCH26),
690 .type = @enumToInt(std.macho.reloc_type_arm64.ARM64_RELOC_BRANCH26),
691691 .target = target,
692692 .offset = offset,
693693 .addend = 0,
......@@ -906,7 +906,7 @@ fn mirLoadMemoryPie(emit: *Emit, inst: Mir.Inst.Index) !void {
906906 .addend = 0,
907907 .pcrel = true,
908908 .length = 2,
909 .@"type" = switch (tag) {
909 .type = switch (tag) {
910910 .load_memory_got,
911911 .load_memory_ptr_got,
912912 => @enumToInt(std.macho.reloc_type_arm64.ARM64_RELOC_GOT_LOAD_PAGE21),
......@@ -922,7 +922,7 @@ fn mirLoadMemoryPie(emit: *Emit, inst: Mir.Inst.Index) !void {
922922 .addend = 0,
923923 .pcrel = false,
924924 .length = 2,
925 .@"type" = switch (tag) {
925 .type = switch (tag) {
926926 .load_memory_got,
927927 .load_memory_ptr_got,
928928 => @enumToInt(std.macho.reloc_type_arm64.ARM64_RELOC_GOT_LOAD_PAGEOFF12),
......@@ -949,7 +949,7 @@ fn mirLoadMemoryPie(emit: *Emit, inst: Mir.Inst.Index) !void {
949949 .addend = 0,
950950 .pcrel = true,
951951 .length = 2,
952 .@"type" = switch (tag) {
952 .type = switch (tag) {
953953 .load_memory_got,
954954 .load_memory_ptr_got,
955955 => .got_page,
......@@ -966,7 +966,7 @@ fn mirLoadMemoryPie(emit: *Emit, inst: Mir.Inst.Index) !void {
966966 .addend = 0,
967967 .pcrel = false,
968968 .length = 2,
969 .@"type" = switch (tag) {
969 .type = switch (tag) {
970970 .load_memory_got,
971971 .load_memory_ptr_got,
972972 => .got_pageoff,
src/arch/sparc64/CodeGen.zig+1-1
......@@ -446,7 +446,7 @@ fn gen(self: *Self) !void {
446446 .data = .{
447447 .arithmetic_2op = .{
448448 .is_imm = true,
449 .rs1 = .@"i7",
449 .rs1 = .i7,
450450 .rs2_or_imm = .{ .imm = 8 },
451451 },
452452 },
src/arch/sparc64/bits.zig+10-10
......@@ -35,14 +35,14 @@ test "Register.id" {
3535 try testing.expectEqual(Register.o6.id(), Register.sp.id());
3636
3737 // FP
38 try testing.expectEqual(@as(u5, 30), Register.@"i6".id());
39 try testing.expectEqual(Register.@"i6".id(), Register.fp.id());
38 try testing.expectEqual(@as(u5, 30), Register.i6.id());
39 try testing.expectEqual(Register.i6.id(), Register.fp.id());
4040
4141 // x0
4242 try testing.expectEqual(@as(u5, 0), Register.g0.id());
4343 try testing.expectEqual(@as(u5, 8), Register.o0.id());
4444 try testing.expectEqual(@as(u5, 16), Register.l0.id());
45 try testing.expectEqual(@as(u5, 24), Register.@"i0".id());
45 try testing.expectEqual(@as(u5, 24), Register.i0.id());
4646}
4747
4848test "Register.enc" {
......@@ -50,13 +50,13 @@ test "Register.enc" {
5050 try testing.expectEqual(@as(u5, 0), Register.g0.enc());
5151 try testing.expectEqual(@as(u5, 8), Register.o0.enc());
5252 try testing.expectEqual(@as(u5, 16), Register.l0.enc());
53 try testing.expectEqual(@as(u5, 24), Register.@"i0".enc());
53 try testing.expectEqual(@as(u5, 24), Register.i0.enc());
5454
5555 // For integer registers, enc() == id().
5656 try testing.expectEqual(Register.g0.enc(), Register.g0.id());
5757 try testing.expectEqual(Register.o0.enc(), Register.o0.id());
5858 try testing.expectEqual(Register.l0.enc(), Register.l0.id());
59 try testing.expectEqual(Register.@"i0".enc(), Register.@"i0".id());
59 try testing.expectEqual(Register.i0.enc(), Register.i0.id());
6060}
6161
6262/// Scalar floating point registers in the SPARCv9 instruction set
......@@ -127,11 +127,11 @@ test "FloatingPointRegister.id" {
127127 // Low region
128128 try testing.expectEqual(@as(u6, 0), FloatingPointRegister.q0.id());
129129 try testing.expectEqual(FloatingPointRegister.q0.id(), FloatingPointRegister.d0.id());
130 try testing.expectEqual(FloatingPointRegister.d0.id(), FloatingPointRegister.@"f0".id());
130 try testing.expectEqual(FloatingPointRegister.d0.id(), FloatingPointRegister.f0.id());
131131
132132 try testing.expectEqual(@as(u6, 28), FloatingPointRegister.q28.id());
133133 try testing.expectEqual(FloatingPointRegister.q28.id(), FloatingPointRegister.d28.id());
134 try testing.expectEqual(FloatingPointRegister.d28.id(), FloatingPointRegister.@"f28".id());
134 try testing.expectEqual(FloatingPointRegister.d28.id(), FloatingPointRegister.f28.id());
135135
136136 // High region
137137 try testing.expectEqual(@as(u6, 32), FloatingPointRegister.q32.id());
......@@ -143,9 +143,9 @@ test "FloatingPointRegister.id" {
143143
144144test "FloatingPointRegister.enc" {
145145 // f registers
146 try testing.expectEqual(@as(u5, 0), FloatingPointRegister.@"f0".enc());
147 try testing.expectEqual(@as(u5, 1), FloatingPointRegister.@"f1".enc());
148 try testing.expectEqual(@as(u5, 31), FloatingPointRegister.@"f31".enc());
146 try testing.expectEqual(@as(u5, 0), FloatingPointRegister.f0.enc());
147 try testing.expectEqual(@as(u5, 1), FloatingPointRegister.f1.enc());
148 try testing.expectEqual(@as(u5, 31), FloatingPointRegister.f31.enc());
149149
150150 // d registers
151151 try testing.expectEqual(@as(u5, 0), FloatingPointRegister.d0.enc());
src/arch/x86_64/CodeGen.zig+9-9
......@@ -132,7 +132,7 @@ pub const MCValue = union(enum) {
132132 /// * got - the value is referenced indirectly via GOT entry index (the linker emits a got-type reloc)
133133 /// * direct - the value is referenced directly via symbol index index (the linker emits a displacement reloc)
134134 /// * import - the value is referenced indirectly via import entry index (the linker emits an import-type reloc)
135 linker_load: struct { @"type": enum { got, direct, import }, sym_index: u32 },
135 linker_load: struct { type: enum { got, direct, import }, sym_index: u32 },
136136 /// The value is one of the stack variables.
137137 /// If the type is a pointer, it means the pointer address is in the stack at this offset.
138138 stack_offset: i32,
......@@ -2671,7 +2671,7 @@ fn loadMemPtrIntoRegister(self: *Self, reg: Register, ptr_ty: Type, ptr: MCValue
26712671 fn_owner_decl.link.macho.sym_index
26722672 else
26732673 fn_owner_decl.link.coff.sym_index;
2674 const flags: u2 = switch (load_struct.@"type") {
2674 const flags: u2 = switch (load_struct.type) {
26752675 .got => 0b00,
26762676 .direct => 0b01,
26772677 .import => 0b10,
......@@ -4010,7 +4010,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallOptions.
40104010 const fn_owner_decl = mod.declPtr(func.owner_decl);
40114011 try self.genSetReg(Type.initTag(.usize), .rax, .{
40124012 .linker_load = .{
4013 .@"type" = .got,
4013 .type = .got,
40144014 .sym_index = fn_owner_decl.link.coff.sym_index,
40154015 },
40164016 });
......@@ -4034,7 +4034,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallOptions.
40344034 const sym_index = try coff_file.getGlobalSymbol(mem.sliceTo(decl_name, 0));
40354035 try self.genSetReg(Type.initTag(.usize), .rax, .{
40364036 .linker_load = .{
4037 .@"type" = .import,
4037 .type = .import,
40384038 .sym_index = sym_index,
40394039 },
40404040 });
......@@ -4070,7 +4070,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallOptions.
40704070 const sym_index = fn_owner_decl.link.macho.sym_index;
40714071 try self.genSetReg(Type.initTag(.usize), .rax, .{
40724072 .linker_load = .{
4073 .@"type" = .got,
4073 .type = .got,
40744074 .sym_index = sym_index,
40754075 },
40764076 });
......@@ -6925,13 +6925,13 @@ fn lowerDeclRef(self: *Self, tv: TypedValue, decl_index: Module.Decl.Index) Inne
69256925 } else if (self.bin_file.cast(link.File.MachO)) |_| {
69266926 assert(decl.link.macho.sym_index != 0);
69276927 return MCValue{ .linker_load = .{
6928 .@"type" = .got,
6928 .type = .got,
69296929 .sym_index = decl.link.macho.sym_index,
69306930 } };
69316931 } else if (self.bin_file.cast(link.File.Coff)) |_| {
69326932 assert(decl.link.coff.sym_index != 0);
69336933 return MCValue{ .linker_load = .{
6934 .@"type" = .got,
6934 .type = .got,
69356935 .sym_index = decl.link.coff.sym_index,
69366936 } };
69376937 } else if (self.bin_file.cast(link.File.Plan9)) |p9| {
......@@ -6953,12 +6953,12 @@ fn lowerUnnamedConst(self: *Self, tv: TypedValue) InnerError!MCValue {
69536953 return MCValue{ .memory = vaddr };
69546954 } else if (self.bin_file.cast(link.File.MachO)) |_| {
69556955 return MCValue{ .linker_load = .{
6956 .@"type" = .direct,
6956 .type = .direct,
69576957 .sym_index = local_sym_index,
69586958 } };
69596959 } else if (self.bin_file.cast(link.File.Coff)) |_| {
69606960 return MCValue{ .linker_load = .{
6961 .@"type" = .direct,
6961 .type = .direct,
69626962 .sym_index = local_sym_index,
69636963 } };
69646964 } else if (self.bin_file.cast(link.File.Plan9)) |p9| {
src/arch/x86_64/Emit.zig+4-4
......@@ -1005,7 +1005,7 @@ fn mirLeaPic(emit: *Emit, inst: Mir.Inst.Index) InnerError!void {
10051005 };
10061006 const atom = macho_file.getAtomForSymbol(.{ .sym_index = relocation.atom_index, .file = null }).?;
10071007 try atom.addRelocation(macho_file, .{
1008 .@"type" = reloc_type,
1008 .type = reloc_type,
10091009 .target = .{ .sym_index = relocation.sym_index, .file = null },
10101010 .offset = @intCast(u32, end_offset - 4),
10111011 .addend = 0,
......@@ -1015,7 +1015,7 @@ fn mirLeaPic(emit: *Emit, inst: Mir.Inst.Index) InnerError!void {
10151015 } else if (emit.bin_file.cast(link.File.Coff)) |coff_file| {
10161016 const atom = coff_file.getAtomForSymbol(.{ .sym_index = relocation.atom_index, .file = null }).?;
10171017 try atom.addRelocation(coff_file, .{
1018 .@"type" = switch (ops.flags) {
1018 .type = switch (ops.flags) {
10191019 0b00 => .got,
10201020 0b01 => .direct,
10211021 0b10 => .import,
......@@ -1145,7 +1145,7 @@ fn mirCallExtern(emit: *Emit, inst: Mir.Inst.Index) InnerError!void {
11451145 const atom = macho_file.getAtomForSymbol(.{ .sym_index = relocation.atom_index, .file = null }).?;
11461146 const target = macho_file.getGlobalByIndex(relocation.sym_index);
11471147 try atom.addRelocation(macho_file, .{
1148 .@"type" = @enumToInt(std.macho.reloc_type_x86_64.X86_64_RELOC_BRANCH),
1148 .type = @enumToInt(std.macho.reloc_type_x86_64.X86_64_RELOC_BRANCH),
11491149 .target = target,
11501150 .offset = offset,
11511151 .addend = 0,
......@@ -1157,7 +1157,7 @@ fn mirCallExtern(emit: *Emit, inst: Mir.Inst.Index) InnerError!void {
11571157 const atom = coff_file.getAtomForSymbol(.{ .sym_index = relocation.atom_index, .file = null }).?;
11581158 const target = coff_file.getGlobalByIndex(relocation.sym_index);
11591159 try atom.addRelocation(coff_file, .{
1160 .@"type" = .direct,
1160 .type = .direct,
11611161 .target = target,
11621162 .offset = offset,
11631163 .addend = 0,
src/codegen/c.zig+10-10
......@@ -607,7 +607,7 @@ pub const DeclGen = struct {
607607 if (val.isUndefDeep()) {
608608 switch (ty.zigTypeTag()) {
609609 // bool b = 0xaa; evals to true, but memcpy(&b, 0xaa, 1); evals to false.
610 .Bool => return dg.renderValue(writer, ty, Value.@"false", location),
610 .Bool => return dg.renderValue(writer, ty, Value.false, location),
611611 .Int, .Enum, .ErrorSet => return writer.print("{x}", .{try dg.fmtIntLiteral(ty, val)}),
612612 .Float => {
613613 const bits = ty.floatBits(target);
......@@ -1964,7 +1964,7 @@ pub const DeclGen = struct {
19641964 try buffer.appendSlice(" }\n");
19651965 }
19661966 try buffer.appendSlice(" }\n while (");
1967 try dg.renderValue(bw, Type.bool, Value.@"true", .Other);
1967 try dg.renderValue(bw, Type.bool, Value.true, .Other);
19681968 try buffer.appendSlice(") ");
19691969 _ = try airBreakpoint(bw);
19701970 try buffer.appendSlice("}\n");
......@@ -3800,7 +3800,7 @@ fn airLoop(f: *Function, inst: Air.Inst.Index) !CValue {
38003800 const body = f.air.extra[loop.end..][0..loop.data.body_len];
38013801 const writer = f.object.writer();
38023802 try writer.writeAll("while (");
3803 try f.object.dg.renderValue(writer, Type.bool, Value.@"true", .Other);
3803 try f.object.dg.renderValue(writer, Type.bool, Value.true, .Other);
38043804 try writer.writeAll(") ");
38053805 try genBody(f, body);
38063806 try writer.writeByte('\n');
......@@ -4095,19 +4095,19 @@ fn airIsNull(
40954095 var slice_ptr_buf: Type.SlicePtrFieldTypeBuffer = undefined;
40964096
40974097 const rhs = if (!payload_ty.hasRuntimeBitsIgnoreComptime())
4098 TypedValue{ .ty = Type.bool, .val = Value.@"true" }
4098 TypedValue{ .ty = Type.bool, .val = Value.true }
40994099 else if (optional_ty.isPtrLikeOptional())
41004100 // operand is a regular pointer, test `operand !=/== NULL`
4101 TypedValue{ .ty = optional_ty, .val = Value.@"null" }
4101 TypedValue{ .ty = optional_ty, .val = Value.null }
41024102 else if (payload_ty.zigTypeTag() == .ErrorSet)
41034103 TypedValue{ .ty = payload_ty, .val = Value.zero }
41044104 else if (payload_ty.isSlice() and optional_ty.optionalReprIsPayload()) rhs: {
41054105 try writer.writeAll(".ptr");
41064106 const slice_ptr_ty = payload_ty.slicePtrFieldType(&slice_ptr_buf);
4107 break :rhs TypedValue{ .ty = slice_ptr_ty, .val = Value.@"null" };
4107 break :rhs TypedValue{ .ty = slice_ptr_ty, .val = Value.null };
41084108 } else rhs: {
41094109 try writer.writeAll(".is_null");
4110 break :rhs TypedValue{ .ty = Type.bool, .val = Value.@"true" };
4110 break :rhs TypedValue{ .ty = Type.bool, .val = Value.true };
41114111 };
41124112 try writer.writeByte(' ');
41134113 try writer.writeAll(operator);
......@@ -4195,7 +4195,7 @@ fn airOptionalPayloadPtrSet(f: *Function, inst: Air.Inst.Index) !CValue {
41954195
41964196 try f.writeCValueDeref(writer, operand);
41974197 try writer.writeAll(".is_null = ");
4198 try f.object.dg.renderValue(writer, Type.bool, Value.@"false", .Initializer);
4198 try f.object.dg.renderValue(writer, Type.bool, Value.false, .Initializer);
41994199 try writer.writeAll(";\n");
42004200
42014201 const inst_ty = f.air.typeOfIndex(inst);
......@@ -4534,7 +4534,7 @@ fn airWrapOptional(f: *Function, inst: Air.Inst.Index) !CValue {
45344534 try writer.writeAll(" = { .payload = ");
45354535 try f.writeCValue(writer, if (is_array) CValue{ .undef = payload_ty } else payload, .Initializer);
45364536 try writer.writeAll(", .is_null = ");
4537 try f.object.dg.renderValue(writer, Type.bool, Value.@"false", .Initializer);
4537 try f.object.dg.renderValue(writer, Type.bool, Value.false, .Initializer);
45384538 try writer.writeAll(" };\n");
45394539 if (is_array) {
45404540 try writer.writeAll("memcpy(");
......@@ -4862,7 +4862,7 @@ fn airCmpxchg(f: *Function, inst: Air.Inst.Index, flavor: [*:0]const u8) !CValue
48624862 try f.writeCValue(writer, expected_value, .Initializer);
48634863 if (is_struct) {
48644864 try writer.writeAll(", .is_null = ");
4865 try f.object.dg.renderValue(writer, Type.bool, Value.@"false", .Initializer);
4865 try f.object.dg.renderValue(writer, Type.bool, Value.false, .Initializer);
48664866 try writer.writeAll(" }");
48674867 }
48684868 try writer.writeAll(";\n");
src/codegen/llvm.zig+1-1
......@@ -10723,7 +10723,7 @@ fn ccAbiPromoteInt(
1072310723 else => {},
1072410724 }
1072510725 const int_info = switch (ty.zigTypeTag()) {
10726 .Bool => Type.@"u1".intInfo(target),
10726 .Bool => Type.u1.intInfo(target),
1072710727 .Int, .Enum, .ErrorSet => ty.intInfo(target),
1072810728 else => return null,
1072910729 };
src/codegen/spirv/type.zig+1-1
......@@ -104,7 +104,7 @@ pub const Type = extern union {
104104 }
105105 return true;
106106 },
107 .@"function" => {
107 .function => {
108108 const fn_a = a.payload(.function);
109109 const fn_b = b.payload(.function);
110110 if (fn_a.return_type != fn_b.return_type)
src/link/Coff.zig+10-10
......@@ -337,7 +337,7 @@ fn populateMissingMetadata(self: *Coff) !void {
337337 .name = [_]u8{0} ** 8,
338338 .value = 0,
339339 .section_number = .UNDEFINED,
340 .@"type" = .{ .base_type = .NULL, .complex_type = .NULL },
340 .type = .{ .base_type = .NULL, .complex_type = .NULL },
341341 .storage_class = .NULL,
342342 .number_of_aux_symbols = 0,
343343 });
......@@ -635,7 +635,7 @@ fn allocateSymbol(self: *Coff) !u32 {
635635 .name = [_]u8{0} ** 8,
636636 .value = 0,
637637 .section_number = .UNDEFINED,
638 .@"type" = .{ .base_type = .NULL, .complex_type = .NULL },
638 .type = .{ .base_type = .NULL, .complex_type = .NULL },
639639 .storage_class = .NULL,
640640 .number_of_aux_symbols = 0,
641641 };
......@@ -730,7 +730,7 @@ fn createGotAtom(self: *Coff, target: SymbolWithLoc) !*Atom {
730730 log.debug("allocated GOT atom at 0x{x}", .{sym.value});
731731
732732 try atom.addRelocation(self, .{
733 .@"type" = .direct,
733 .type = .direct,
734734 .target = target,
735735 .offset = 0,
736736 .addend = 0,
......@@ -1106,7 +1106,7 @@ fn updateDeclCode(self: *Coff, decl_index: Module.Decl.Index, code: []const u8,
11061106 const sym = atom.getSymbolPtr(self);
11071107 try self.setSymbolName(sym, decl_name);
11081108 sym.section_number = @intToEnum(coff.SectionNumber, sect_index + 1);
1109 sym.@"type" = .{ .complex_type = complex_type, .base_type = .NULL };
1109 sym.type = .{ .complex_type = complex_type, .base_type = .NULL };
11101110
11111111 const capacity = atom.capacity(self);
11121112 const need_realloc = code.len > capacity or !mem.isAlignedGeneric(u64, sym.value, required_alignment);
......@@ -1131,7 +1131,7 @@ fn updateDeclCode(self: *Coff, decl_index: Module.Decl.Index, code: []const u8,
11311131 const sym = atom.getSymbolPtr(self);
11321132 try self.setSymbolName(sym, decl_name);
11331133 sym.section_number = @intToEnum(coff.SectionNumber, sect_index + 1);
1134 sym.@"type" = .{ .complex_type = complex_type, .base_type = .NULL };
1134 sym.type = .{ .complex_type = complex_type, .base_type = .NULL };
11351135
11361136 const vaddr = try self.allocateAtom(atom, code_len, required_alignment);
11371137 errdefer self.freeAtom(atom);
......@@ -1307,7 +1307,7 @@ pub fn updateDeclExports(
13071307 try self.setSymbolName(sym, exp.options.name);
13081308 sym.value = decl_sym.value;
13091309 sym.section_number = @intToEnum(coff.SectionNumber, self.text_section_index.? + 1);
1310 sym.@"type" = .{ .complex_type = .FUNCTION, .base_type = .NULL };
1310 sym.type = .{ .complex_type = .FUNCTION, .base_type = .NULL };
13111311
13121312 switch (exp.options.linkage) {
13131313 .Strong => {
......@@ -1337,7 +1337,7 @@ pub fn deleteExport(self: *Coff, exp: Export) void {
13371337 .name = [_]u8{0} ** 8,
13381338 .value = 0,
13391339 .section_number = .UNDEFINED,
1340 .@"type" = .{ .base_type = .NULL, .complex_type = .NULL },
1340 .type = .{ .base_type = .NULL, .complex_type = .NULL },
13411341 .storage_class = .NULL,
13421342 .number_of_aux_symbols = 0,
13431343 };
......@@ -1465,7 +1465,7 @@ pub fn getDeclVAddr(
14651465 const atom = self.getAtomForSymbol(.{ .sym_index = reloc_info.parent_atom_index, .file = null }).?;
14661466 const target = SymbolWithLoc{ .sym_index = decl.link.coff.sym_index, .file = null };
14671467 try atom.addRelocation(self, .{
1468 .@"type" = .direct,
1468 .type = .direct,
14691469 .target = target,
14701470 .offset = @intCast(u32, reloc_info.offset),
14711471 .addend = reloc_info.addend,
......@@ -1537,7 +1537,7 @@ fn writeBaseRelocations(self: *Coff) !void {
15371537 }
15381538 try gop.value_ptr.append(.{
15391539 .offset = @intCast(u12, rva - page),
1540 .@"type" = .DIR64,
1540 .type = .DIR64,
15411541 });
15421542 }
15431543 }
......@@ -1555,7 +1555,7 @@ fn writeBaseRelocations(self: *Coff) !void {
15551555 )) {
15561556 try entry.value_ptr.append(.{
15571557 .offset = 0,
1558 .@"type" = .ABSOLUTE,
1558 .type = .ABSOLUTE,
15591559 });
15601560 }
15611561
src/link/Coff/Atom.zig+1-1
......@@ -94,7 +94,7 @@ pub fn freeListEligible(self: Atom, coff_file: *const Coff) bool {
9494
9595pub fn addRelocation(self: *Atom, coff_file: *Coff, reloc: Relocation) !void {
9696 const gpa = coff_file.base.allocator;
97 log.debug(" (adding reloc of type {s} to target %{d})", .{ @tagName(reloc.@"type"), reloc.target.sym_index });
97 log.debug(" (adding reloc of type {s} to target %{d})", .{ @tagName(reloc.type), reloc.target.sym_index });
9898 const gop = try coff_file.relocs.getOrPut(gpa, self);
9999 if (!gop.found_existing) {
100100 gop.value_ptr.* = .{};
src/link/Coff/Relocation.zig+5-5
......@@ -13,7 +13,7 @@ const Atom = @import("Atom.zig");
1313const Coff = @import("../Coff.zig");
1414const SymbolWithLoc = Coff.SymbolWithLoc;
1515
16@"type": enum {
16type: enum {
1717 // x86, x86_64
1818 /// RIP-relative displacement to a GOT pointer
1919 got,
......@@ -47,7 +47,7 @@ dirty: bool = true,
4747
4848/// Returns an Atom which is the target node of this relocation edge (if any).
4949pub fn getTargetAtom(self: Relocation, coff_file: *Coff) ?*Atom {
50 switch (self.@"type") {
50 switch (self.type) {
5151 .got,
5252 .got_page,
5353 .got_pageoff,
......@@ -80,7 +80,7 @@ pub fn resolve(self: *Relocation, atom: *Atom, coff_file: *Coff) !void {
8080 source_vaddr,
8181 target_vaddr_with_addend,
8282 coff_file.getSymbolName(self.target),
83 @tagName(self.@"type"),
83 @tagName(self.type),
8484 file_offset + self.offset,
8585 });
8686
......@@ -121,7 +121,7 @@ fn resolveAarch64(self: *Relocation, ctx: Context, coff_file: *Coff) !void {
121121 else => unreachable,
122122 }
123123
124 switch (self.@"type") {
124 switch (self.type) {
125125 .got_page, .import_page, .page => {
126126 const source_page = @intCast(i32, ctx.source_vaddr >> 12);
127127 const target_page = @intCast(i32, ctx.target_vaddr >> 12);
......@@ -198,7 +198,7 @@ fn resolveAarch64(self: *Relocation, ctx: Context, coff_file: *Coff) !void {
198198}
199199
200200fn resolveX86(self: *Relocation, ctx: Context, coff_file: *Coff) !void {
201 switch (self.@"type") {
201 switch (self.type) {
202202 .got_page => unreachable,
203203 .got_pageoff => unreachable,
204204 .page => unreachable,
src/link/Dwarf.zig+7-7
......@@ -104,7 +104,7 @@ pub const DeclState = struct {
104104 pub fn addExprlocReloc(self: *DeclState, target: u32, offset: u32, is_ptr: bool) !void {
105105 log.debug("{x}: target sym %{d}, via GOT {}", .{ offset, target, is_ptr });
106106 try self.exprloc_relocs.append(self.gpa, .{
107 .@"type" = if (is_ptr) .got_load else .direct_load,
107 .type = if (is_ptr) .got_load else .direct_load,
108108 .target = target,
109109 .offset = offset,
110110 });
......@@ -132,7 +132,7 @@ pub const DeclState = struct {
132132 const sym_index = @intCast(u32, self.abbrev_table.items.len);
133133 try self.abbrev_table.append(self.gpa, .{
134134 .atom = atom,
135 .@"type" = ty,
135 .type = ty,
136136 .offset = undefined,
137137 });
138138 log.debug("%{d}: {}", .{ sym_index, ty.fmtDebug() });
......@@ -564,7 +564,7 @@ pub const DeclState = struct {
564564
565565pub const AbbrevEntry = struct {
566566 atom: *const Atom,
567 @"type": Type,
567 type: Type,
568568 offset: u32,
569569};
570570
......@@ -579,7 +579,7 @@ pub const AbbrevRelocation = struct {
579579
580580pub const ExprlocRelocation = struct {
581581 /// Type of the relocation: direct load ref, or GOT load ref (via GOT table)
582 @"type": enum {
582 type: enum {
583583 direct_load,
584584 got_load,
585585 },
......@@ -1022,7 +1022,7 @@ pub fn commitDeclState(
10221022 var sym_index: usize = 0;
10231023 while (sym_index < decl_state.abbrev_table.items.len) : (sym_index += 1) {
10241024 const symbol = &decl_state.abbrev_table.items[sym_index];
1025 const ty = symbol.@"type";
1025 const ty = symbol.type;
10261026 const deferred: bool = blk: {
10271027 if (ty.isAnyError()) break :blk true;
10281028 switch (ty.tag()) {
......@@ -1046,7 +1046,7 @@ pub fn commitDeclState(
10461046 while (decl_state.abbrev_relocs.popOrNull()) |reloc| {
10471047 if (reloc.target) |target| {
10481048 const symbol = decl_state.abbrev_table.items[target];
1049 const ty = symbol.@"type";
1049 const ty = symbol.type;
10501050 const deferred: bool = blk: {
10511051 if (ty.isAnyError()) break :blk true;
10521052 switch (ty.tag()) {
......@@ -1091,7 +1091,7 @@ pub fn commitDeclState(
10911091 const macho_file = file.cast(File.MachO).?;
10921092 const d_sym = &macho_file.d_sym.?;
10931093 try d_sym.relocs.append(d_sym.base.base.allocator, .{
1094 .@"type" = switch (reloc.@"type") {
1094 .type = switch (reloc.type) {
10951095 .direct_load => .direct_load,
10961096 .got_load => .got_load,
10971097 },
src/link/MachO.zig+17-17
......@@ -1059,7 +1059,7 @@ pub fn createGotAtom(self: *MachO, target: SymbolWithLoc) !*Atom {
10591059 log.debug("allocated GOT atom at 0x{x}", .{sym.n_value});
10601060
10611061 try atom.addRelocation(self, .{
1062 .@"type" = switch (self.base.options.target.cpu.arch) {
1062 .type = switch (self.base.options.target.cpu.arch) {
10631063 .aarch64 => @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_UNSIGNED),
10641064 .x86_64 => @enumToInt(macho.reloc_type_x86_64.X86_64_RELOC_UNSIGNED),
10651065 else => unreachable,
......@@ -1164,14 +1164,14 @@ pub fn createStubHelperPreambleAtom(self: *MachO) !void {
11641164 code[10] = 0x25;
11651165
11661166 try atom.addRelocations(self, 2, .{ .{
1167 .@"type" = @enumToInt(macho.reloc_type_x86_64.X86_64_RELOC_SIGNED),
1167 .type = @enumToInt(macho.reloc_type_x86_64.X86_64_RELOC_SIGNED),
11681168 .target = .{ .sym_index = dyld_private_sym_index, .file = null },
11691169 .offset = 3,
11701170 .addend = 0,
11711171 .pcrel = true,
11721172 .length = 2,
11731173 }, .{
1174 .@"type" = @enumToInt(macho.reloc_type_x86_64.X86_64_RELOC_GOT),
1174 .type = @enumToInt(macho.reloc_type_x86_64.X86_64_RELOC_GOT),
11751175 .target = .{ .sym_index = self.dyld_stub_binder_index.?, .file = null },
11761176 .offset = 11,
11771177 .addend = 0,
......@@ -1204,28 +1204,28 @@ pub fn createStubHelperPreambleAtom(self: *MachO) !void {
12041204 mem.writeIntLittle(u32, code[20..][0..4], aarch64.Instruction.br(.x16).toU32());
12051205
12061206 try atom.addRelocations(self, 4, .{ .{
1207 .@"type" = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_PAGE21),
1207 .type = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_PAGE21),
12081208 .target = .{ .sym_index = dyld_private_sym_index, .file = null },
12091209 .offset = 0,
12101210 .addend = 0,
12111211 .pcrel = true,
12121212 .length = 2,
12131213 }, .{
1214 .@"type" = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_PAGEOFF12),
1214 .type = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_PAGEOFF12),
12151215 .target = .{ .sym_index = dyld_private_sym_index, .file = null },
12161216 .offset = 4,
12171217 .addend = 0,
12181218 .pcrel = false,
12191219 .length = 2,
12201220 }, .{
1221 .@"type" = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_GOT_LOAD_PAGE21),
1221 .type = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_GOT_LOAD_PAGE21),
12221222 .target = .{ .sym_index = self.dyld_stub_binder_index.?, .file = null },
12231223 .offset = 12,
12241224 .addend = 0,
12251225 .pcrel = true,
12261226 .length = 2,
12271227 }, .{
1228 .@"type" = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_GOT_LOAD_PAGEOFF12),
1228 .type = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_GOT_LOAD_PAGEOFF12),
12291229 .target = .{ .sym_index = self.dyld_stub_binder_index.?, .file = null },
12301230 .offset = 16,
12311231 .addend = 0,
......@@ -1286,7 +1286,7 @@ pub fn createStubHelperAtom(self: *MachO) !*Atom {
12861286 code[5] = 0xe9;
12871287
12881288 try atom.addRelocation(self, .{
1289 .@"type" = @enumToInt(macho.reloc_type_x86_64.X86_64_RELOC_BRANCH),
1289 .type = @enumToInt(macho.reloc_type_x86_64.X86_64_RELOC_BRANCH),
12901290 .target = .{ .sym_index = self.stub_helper_preamble_atom.?.sym_index, .file = null },
12911291 .offset = 6,
12921292 .addend = 0,
......@@ -1309,7 +1309,7 @@ pub fn createStubHelperAtom(self: *MachO) !*Atom {
13091309 // Next 4 bytes 8..12 are just a placeholder populated in `populateLazyBindOffsetsInStubHelper`.
13101310
13111311 try atom.addRelocation(self, .{
1312 .@"type" = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_BRANCH26),
1312 .type = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_BRANCH26),
13131313 .target = .{ .sym_index = self.stub_helper_preamble_atom.?.sym_index, .file = null },
13141314 .offset = 4,
13151315 .addend = 0,
......@@ -1348,7 +1348,7 @@ pub fn createLazyPointerAtom(self: *MachO, stub_sym_index: u32, target: SymbolWi
13481348 sym.n_sect = self.la_symbol_ptr_section_index.? + 1;
13491349
13501350 try atom.addRelocation(self, .{
1351 .@"type" = switch (self.base.options.target.cpu.arch) {
1351 .type = switch (self.base.options.target.cpu.arch) {
13521352 .aarch64 => @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_UNSIGNED),
13531353 .x86_64 => @enumToInt(macho.reloc_type_x86_64.X86_64_RELOC_UNSIGNED),
13541354 else => unreachable,
......@@ -1414,7 +1414,7 @@ pub fn createStubAtom(self: *MachO, laptr_sym_index: u32) !*Atom {
14141414 code[1] = 0x25;
14151415
14161416 try atom.addRelocation(self, .{
1417 .@"type" = @enumToInt(macho.reloc_type_x86_64.X86_64_RELOC_BRANCH),
1417 .type = @enumToInt(macho.reloc_type_x86_64.X86_64_RELOC_BRANCH),
14181418 .target = .{ .sym_index = laptr_sym_index, .file = null },
14191419 .offset = 2,
14201420 .addend = 0,
......@@ -1436,7 +1436,7 @@ pub fn createStubAtom(self: *MachO, laptr_sym_index: u32) !*Atom {
14361436
14371437 try atom.addRelocations(self, 2, .{
14381438 .{
1439 .@"type" = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_PAGE21),
1439 .type = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_PAGE21),
14401440 .target = .{ .sym_index = laptr_sym_index, .file = null },
14411441 .offset = 0,
14421442 .addend = 0,
......@@ -1444,7 +1444,7 @@ pub fn createStubAtom(self: *MachO, laptr_sym_index: u32) !*Atom {
14441444 .length = 2,
14451445 },
14461446 .{
1447 .@"type" = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_PAGEOFF12),
1447 .type = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_PAGEOFF12),
14481448 .target = .{ .sym_index = laptr_sym_index, .file = null },
14491449 .offset = 4,
14501450 .addend = 0,
......@@ -2446,7 +2446,7 @@ pub fn getOutputSection(self: *MachO, sect: macho.section_64) !?u8 {
24462446 break :blk null;
24472447 }
24482448
2449 switch (sect.@"type"()) {
2449 switch (sect.type()) {
24502450 macho.S_4BYTE_LITERALS,
24512451 macho.S_8BYTE_LITERALS,
24522452 macho.S_16BYTE_LITERALS,
......@@ -2827,7 +2827,7 @@ pub fn getDeclVAddr(self: *MachO, decl_index: Module.Decl.Index, reloc_info: Fil
28272827
28282828 const atom = self.getAtomForSymbol(.{ .sym_index = reloc_info.parent_atom_index, .file = null }).?;
28292829 try atom.addRelocation(self, .{
2830 .@"type" = switch (self.base.options.target.cpu.arch) {
2830 .type = switch (self.base.options.target.cpu.arch) {
28312831 .aarch64 => @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_UNSIGNED),
28322832 .x86_64 => @enumToInt(macho.reloc_type_x86_64.X86_64_RELOC_UNSIGNED),
28332833 else => unreachable,
......@@ -3345,10 +3345,10 @@ fn allocateAtom(self: *MachO, atom: *Atom, new_atom_size: u64, alignment: u64) !
33453345fn getSectionPrecedence(header: macho.section_64) u4 {
33463346 if (header.isCode()) {
33473347 if (mem.eql(u8, "__text", header.sectName())) return 0x0;
3348 if (header.@"type"() == macho.S_SYMBOL_STUBS) return 0x1;
3348 if (header.type() == macho.S_SYMBOL_STUBS) return 0x1;
33493349 return 0x2;
33503350 }
3351 switch (header.@"type"()) {
3351 switch (header.type()) {
33523352 macho.S_NON_LAZY_SYMBOL_POINTERS,
33533353 macho.S_LAZY_SYMBOL_POINTERS,
33543354 => return 0x0,
src/link/MachO/DebugSymbols.zig+3-3
......@@ -47,7 +47,7 @@ strtab: StringTable(.strtab) = .{},
4747relocs: std.ArrayListUnmanaged(Reloc) = .{},
4848
4949pub const Reloc = struct {
50 @"type": enum {
50 type: enum {
5151 direct_load,
5252 got_load,
5353 },
......@@ -188,7 +188,7 @@ pub fn flushModule(self: *DebugSymbols, allocator: Allocator, options: link.Opti
188188 const module = options.module orelse return error.LinkingWithoutZigSourceUnimplemented;
189189
190190 for (self.relocs.items) |*reloc| {
191 const sym = switch (reloc.@"type") {
191 const sym = switch (reloc.type) {
192192 .direct_load => self.base.getSymbol(.{ .sym_index = reloc.target, .file = null }),
193193 .got_load => blk: {
194194 const got_index = self.base.got_entries_table.get(.{
......@@ -201,7 +201,7 @@ pub fn flushModule(self: *DebugSymbols, allocator: Allocator, options: link.Opti
201201 };
202202 if (sym.n_value == reloc.prev_vaddr) continue;
203203
204 const sym_name = switch (reloc.@"type") {
204 const sym_name = switch (reloc.type) {
205205 .direct_load => self.base.getSymbolName(.{ .sym_index = reloc.target, .file = null }),
206206 .got_load => blk: {
207207 const got_index = self.base.got_entries_table.get(.{
src/link/MachO/DwarfInfo.zig+1-1
......@@ -185,7 +185,7 @@ const AbbrevEntryIterator = struct {
185185 self.pos += (math.cast(usize, creader.bytes_read) orelse return error.Overflow);
186186
187187 if (kind == 0) {
188 return AbbrevEntry.@"null"();
188 return AbbrevEntry.null();
189189 }
190190
191191 const abbrev_pos = lookup.get(kind) orelse return error.MalformedDwarf;
src/link/MachO/Relocation.zig+7-7
......@@ -13,7 +13,7 @@ const Atom = @import("Atom.zig");
1313const MachO = @import("../MachO.zig");
1414const SymbolWithLoc = MachO.SymbolWithLoc;
1515
16@"type": u4,
16type: u4,
1717target: SymbolWithLoc,
1818offset: u32,
1919addend: i64,
......@@ -23,22 +23,22 @@ dirty: bool = true,
2323
2424pub fn fmtType(self: Relocation, target: std.Target) []const u8 {
2525 switch (target.cpu.arch) {
26 .aarch64 => return @tagName(@intToEnum(macho.reloc_type_arm64, self.@"type")),
27 .x86_64 => return @tagName(@intToEnum(macho.reloc_type_x86_64, self.@"type")),
26 .aarch64 => return @tagName(@intToEnum(macho.reloc_type_arm64, self.type)),
27 .x86_64 => return @tagName(@intToEnum(macho.reloc_type_x86_64, self.type)),
2828 else => unreachable,
2929 }
3030}
3131
3232pub fn getTargetAtom(self: Relocation, macho_file: *MachO) ?*Atom {
3333 switch (macho_file.base.options.target.cpu.arch) {
34 .aarch64 => switch (@intToEnum(macho.reloc_type_arm64, self.@"type")) {
34 .aarch64 => switch (@intToEnum(macho.reloc_type_arm64, self.type)) {
3535 .ARM64_RELOC_GOT_LOAD_PAGE21,
3636 .ARM64_RELOC_GOT_LOAD_PAGEOFF12,
3737 .ARM64_RELOC_POINTER_TO_GOT,
3838 => return macho_file.getGotAtomForSymbol(self.target),
3939 else => {},
4040 },
41 .x86_64 => switch (@intToEnum(macho.reloc_type_x86_64, self.@"type")) {
41 .x86_64 => switch (@intToEnum(macho.reloc_type_x86_64, self.type)) {
4242 .X86_64_RELOC_GOT,
4343 .X86_64_RELOC_GOT_LOAD,
4444 => return macho_file.getGotAtomForSymbol(self.target),
......@@ -79,7 +79,7 @@ fn resolveAarch64(
7979 target_addr: i64,
8080 base_offset: u64,
8181) !void {
82 const rel_type = @intToEnum(macho.reloc_type_arm64, self.@"type");
82 const rel_type = @intToEnum(macho.reloc_type_arm64, self.type);
8383 if (rel_type == .ARM64_RELOC_UNSIGNED) {
8484 var buffer: [@sizeOf(u64)]u8 = undefined;
8585 const code = blk: {
......@@ -232,7 +232,7 @@ fn resolveX8664(
232232 target_addr: i64,
233233 base_offset: u64,
234234) !void {
235 const rel_type = @intToEnum(macho.reloc_type_x86_64, self.@"type");
235 const rel_type = @intToEnum(macho.reloc_type_x86_64, self.type);
236236 var buffer: [@sizeOf(u64)]u8 = undefined;
237237 const code = blk: {
238238 switch (rel_type) {
src/link/MachO/ZldAtom.zig+2-2
......@@ -596,7 +596,7 @@ fn resolveRelocsArm64(
596596 const is_tlv = is_tlv: {
597597 const source_sym = zld.getSymbol(atom.getSymbolWithLoc());
598598 const header = zld.sections.items(.header)[source_sym.n_sect - 1];
599 break :is_tlv header.@"type"() == macho.S_THREAD_LOCAL_VARIABLES;
599 break :is_tlv header.type() == macho.S_THREAD_LOCAL_VARIABLES;
600600 };
601601 const target_addr = try getRelocTargetAddress(zld, rel, target, is_tlv);
602602
......@@ -877,7 +877,7 @@ fn resolveRelocsX86(
877877 const is_tlv = is_tlv: {
878878 const source_sym = zld.getSymbol(atom.getSymbolWithLoc());
879879 const header = zld.sections.items(.header)[source_sym.n_sect - 1];
880 break :is_tlv header.@"type"() == macho.S_THREAD_LOCAL_VARIABLES;
880 break :is_tlv header.type() == macho.S_THREAD_LOCAL_VARIABLES;
881881 };
882882
883883 log.debug(" | source_addr = 0x{x}", .{source_addr});
src/link/MachO/dead_strip.zig+1-1
......@@ -107,7 +107,7 @@ fn collectRoots(zld: *Zld, roots: *AtomTable) !void {
107107 };
108108 const source_sect = object.getSourceSection(sect_id);
109109 if (source_sect.isDontDeadStrip()) break :blk true;
110 switch (source_sect.@"type"()) {
110 switch (source_sect.type()) {
111111 macho.S_MOD_INIT_FUNC_POINTERS,
112112 macho.S_MOD_TERM_FUNC_POINTERS,
113113 => break :blk true,
src/link/MachO/zld.zig+9-9
......@@ -396,7 +396,7 @@ pub const Zld = struct {
396396 break :blk null;
397397 }
398398
399 switch (sect.@"type"()) {
399 switch (sect.type()) {
400400 macho.S_4BYTE_LITERALS,
401401 macho.S_8BYTE_LITERALS,
402402 macho.S_16BYTE_LITERALS,
......@@ -1701,7 +1701,7 @@ pub const Zld = struct {
17011701 break :outer;
17021702 }
17031703 }
1704 switch (header.@"type"()) {
1704 switch (header.type()) {
17051705 macho.S_NON_LAZY_SYMBOL_POINTERS => {
17061706 try self.writeGotPointer(count, buffer.writer());
17071707 },
......@@ -1718,7 +1718,7 @@ pub const Zld = struct {
17181718 break :outer;
17191719 }
17201720 }
1721 if (header.@"type"() == macho.S_SYMBOL_STUBS) {
1721 if (header.type() == macho.S_SYMBOL_STUBS) {
17221722 try self.writeStubCode(atom_index, count, buffer.writer());
17231723 } else if (mem.eql(u8, header.sectName(), "__stub_helper")) {
17241724 try self.writeStubHelperCode(atom_index, buffer.writer());
......@@ -1802,7 +1802,7 @@ pub const Zld = struct {
18021802 for (slice.items(.header)) |*header, sect_id| {
18031803 if (header.size == 0) continue;
18041804 if (self.requiresThunks()) {
1805 if (header.isCode() and !(header.@"type"() == macho.S_SYMBOL_STUBS) and !mem.eql(u8, header.sectName(), "__stub_helper")) continue;
1805 if (header.isCode() and !(header.type() == macho.S_SYMBOL_STUBS) and !mem.eql(u8, header.sectName(), "__stub_helper")) continue;
18061806 }
18071807
18081808 var atom_index = slice.items(.first_atom_index)[sect_id];
......@@ -1830,7 +1830,7 @@ pub const Zld = struct {
18301830 if (self.requiresThunks()) {
18311831 for (slice.items(.header)) |header, sect_id| {
18321832 if (!header.isCode()) continue;
1833 if (header.@"type"() == macho.S_SYMBOL_STUBS) continue;
1833 if (header.type() == macho.S_SYMBOL_STUBS) continue;
18341834 if (mem.eql(u8, header.sectName(), "__stub_helper")) continue;
18351835
18361836 // Create jump/branch range extenders if needed.
......@@ -1994,10 +1994,10 @@ pub const Zld = struct {
19941994 const section_precedence: u4 = blk: {
19951995 if (header.isCode()) {
19961996 if (mem.eql(u8, "__text", header.sectName())) break :blk 0x0;
1997 if (header.@"type"() == macho.S_SYMBOL_STUBS) break :blk 0x1;
1997 if (header.type() == macho.S_SYMBOL_STUBS) break :blk 0x1;
19981998 break :blk 0x2;
19991999 }
2000 switch (header.@"type"()) {
2000 switch (header.type()) {
20012001 macho.S_NON_LAZY_SYMBOL_POINTERS,
20022002 macho.S_LAZY_SYMBOL_POINTERS,
20032003 => break :blk 0x0,
......@@ -2121,7 +2121,7 @@ pub const Zld = struct {
21212121
21222122 // Finally, unpack the rest.
21232123 for (slice.items(.header)) |header, sect_id| {
2124 switch (header.@"type"()) {
2124 switch (header.type()) {
21252125 macho.S_LITERAL_POINTERS,
21262126 macho.S_REGULAR,
21272127 macho.S_MOD_INIT_FUNC_POINTERS,
......@@ -2252,7 +2252,7 @@ pub const Zld = struct {
22522252 // Finally, unpack the rest.
22532253 const slice = self.sections.slice();
22542254 for (slice.items(.header)) |header, sect_id| {
2255 switch (header.@"type"()) {
2255 switch (header.type()) {
22562256 macho.S_LITERAL_POINTERS,
22572257 macho.S_REGULAR,
22582258 macho.S_MOD_INIT_FUNC_POINTERS,
src/test.zig+4-4
......@@ -213,7 +213,7 @@ const TestManifestConfigDefaults = struct {
213213///
214214/// build test
215215const TestManifest = struct {
216 @"type": Type,
216 type: Type,
217217 config_map: std.StringHashMap([]const u8),
218218 trailing_bytes: []const u8 = "",
219219
......@@ -294,7 +294,7 @@ const TestManifest = struct {
294294 };
295295
296296 var manifest: TestManifest = .{
297 .@"type" = tt,
297 .type = tt,
298298 .config_map = std.StringHashMap([]const u8).init(arena),
299299 };
300300
......@@ -320,7 +320,7 @@ const TestManifest = struct {
320320 key: []const u8,
321321 comptime T: type,
322322 ) ConfigValueIterator(T) {
323 const bytes = self.config_map.get(key) orelse TestManifestConfigDefaults.get(self.@"type", key);
323 const bytes = self.config_map.get(key) orelse TestManifestConfigDefaults.get(self.type, key);
324324 return ConfigValueIterator(T){
325325 .inner = std.mem.split(u8, bytes, ","),
326326 };
......@@ -1157,7 +1157,7 @@ pub const TestContext = struct {
11571157
11581158 for (cases.items) |case_index| {
11591159 const case = &ctx.cases.items[case_index];
1160 switch (manifest.@"type") {
1160 switch (manifest.type) {
11611161 .@"error" => {
11621162 const errors = try manifest.trailingAlloc(ctx.arena);
11631163 switch (strategy) {
src/type.zig+39-39
......@@ -80,8 +80,8 @@ pub const Type = extern union {
8080 .comptime_int => return .ComptimeInt,
8181 .comptime_float => return .ComptimeFloat,
8282 .noreturn => return .NoReturn,
83 .@"null" => return .Null,
84 .@"undefined" => return .Undefined,
83 .null => return .Null,
84 .undefined => return .Undefined,
8585
8686 .fn_noreturn_no_args => return .Fn,
8787 .fn_void_no_args => return .Fn,
......@@ -556,9 +556,9 @@ pub const Type = extern union {
556556 .comptime_int,
557557 .comptime_float,
558558 .noreturn,
559 .@"null",
560 .@"undefined",
561 .@"anyopaque",
559 .null,
560 .undefined,
561 .anyopaque,
562562 .@"anyframe",
563563 .enum_literal,
564564 => |a_tag| {
......@@ -962,12 +962,12 @@ pub const Type = extern union {
962962 .comptime_int => std.hash.autoHash(hasher, std.builtin.TypeId.ComptimeInt),
963963 .comptime_float => std.hash.autoHash(hasher, std.builtin.TypeId.ComptimeFloat),
964964 .noreturn => std.hash.autoHash(hasher, std.builtin.TypeId.NoReturn),
965 .@"null" => std.hash.autoHash(hasher, std.builtin.TypeId.Null),
966 .@"undefined" => std.hash.autoHash(hasher, std.builtin.TypeId.Undefined),
965 .null => std.hash.autoHash(hasher, std.builtin.TypeId.Null),
966 .undefined => std.hash.autoHash(hasher, std.builtin.TypeId.Undefined),
967967
968 .@"anyopaque" => {
968 .anyopaque => {
969969 std.hash.autoHash(hasher, std.builtin.TypeId.Opaque);
970 std.hash.autoHash(hasher, Tag.@"anyopaque");
970 std.hash.autoHash(hasher, Tag.anyopaque);
971971 },
972972
973973 .@"anyframe" => {
......@@ -1299,8 +1299,8 @@ pub const Type = extern union {
12991299 .comptime_int,
13001300 .comptime_float,
13011301 .noreturn,
1302 .@"null",
1303 .@"undefined",
1302 .null,
1303 .undefined,
13041304 .fn_noreturn_no_args,
13051305 .fn_void_no_args,
13061306 .fn_naked_noreturn_no_args,
......@@ -1596,8 +1596,8 @@ pub const Type = extern union {
15961596 => return writer.writeAll(@tagName(t)),
15971597
15981598 .enum_literal => return writer.writeAll("@Type(.EnumLiteral)"),
1599 .@"null" => return writer.writeAll("@Type(.Null)"),
1600 .@"undefined" => return writer.writeAll("@Type(.Undefined)"),
1599 .null => return writer.writeAll("@Type(.Null)"),
1600 .undefined => return writer.writeAll("@Type(.Undefined)"),
16011601
16021602 .empty_struct, .empty_struct_literal => return writer.writeAll("struct {}"),
16031603
......@@ -1979,8 +1979,8 @@ pub const Type = extern union {
19791979 => try writer.writeAll(@tagName(t)),
19801980
19811981 .enum_literal => try writer.writeAll("@TypeOf(.enum_literal)"),
1982 .@"null" => try writer.writeAll("@TypeOf(null)"),
1983 .@"undefined" => try writer.writeAll("@TypeOf(undefined)"),
1982 .null => try writer.writeAll("@TypeOf(null)"),
1983 .undefined => try writer.writeAll("@TypeOf(undefined)"),
19841984 .empty_struct_literal => try writer.writeAll("@TypeOf(.{})"),
19851985
19861986 .empty_struct => {
......@@ -2282,8 +2282,8 @@ pub const Type = extern union {
22822282 .comptime_int => return Value.initTag(.comptime_int_type),
22832283 .comptime_float => return Value.initTag(.comptime_float_type),
22842284 .noreturn => return Value.initTag(.noreturn_type),
2285 .@"null" => return Value.initTag(.null_type),
2286 .@"undefined" => return Value.initTag(.undefined_type),
2285 .null => return Value.initTag(.null_type),
2286 .undefined => return Value.initTag(.undefined_type),
22872287 .fn_noreturn_no_args => return Value.initTag(.fn_noreturn_no_args_type),
22882288 .fn_void_no_args => return Value.initTag(.fn_void_no_args_type),
22892289 .fn_naked_noreturn_no_args => return Value.initTag(.fn_naked_noreturn_no_args_type),
......@@ -2420,8 +2420,8 @@ pub const Type = extern union {
24202420 .comptime_int,
24212421 .comptime_float,
24222422 .noreturn,
2423 .@"null",
2424 .@"undefined",
2423 .null,
2424 .undefined,
24252425 .enum_literal,
24262426 .empty_struct,
24272427 .empty_struct_literal,
......@@ -2600,9 +2600,9 @@ pub const Type = extern union {
26002600 .anyopaque,
26012601 .anyerror,
26022602 .noreturn,
2603 .@"null",
2603 .null,
26042604 .@"anyframe",
2605 .@"undefined",
2605 .undefined,
26062606 .atomic_order,
26072607 .atomic_rmw_op,
26082608 .calling_convention,
......@@ -3109,8 +3109,8 @@ pub const Type = extern union {
31093109 .type,
31103110 .comptime_int,
31113111 .comptime_float,
3112 .@"null",
3113 .@"undefined",
3112 .null,
3113 .undefined,
31143114 .enum_literal,
31153115 .type_info,
31163116 => return AbiAlignmentAdvanced{ .scalar = 0 },
......@@ -3231,8 +3231,8 @@ pub const Type = extern union {
32313231 .type,
32323232 .comptime_int,
32333233 .comptime_float,
3234 .@"null",
3235 .@"undefined",
3234 .null,
3235 .undefined,
32363236 .enum_literal,
32373237 .single_const_pointer_to_comptime_int,
32383238 .empty_struct_literal,
......@@ -3554,8 +3554,8 @@ pub const Type = extern union {
35543554 .comptime_int => unreachable,
35553555 .comptime_float => unreachable,
35563556 .noreturn => unreachable,
3557 .@"null" => unreachable,
3558 .@"undefined" => unreachable,
3557 .null => unreachable,
3558 .undefined => unreachable,
35593559 .enum_literal => unreachable,
35603560 .single_const_pointer_to_comptime_int => unreachable,
35613561 .empty_struct => unreachable,
......@@ -4157,7 +4157,7 @@ pub const Type = extern union {
41574157 .optional_single_const_pointer => ty.castPointer().?.data,
41584158
41594159 .anyframe_T => ty.castTag(.anyframe_T).?.data,
4160 .@"anyframe" => Type.@"void",
4160 .@"anyframe" => Type.void,
41614161
41624162 else => unreachable,
41634163 };
......@@ -4975,7 +4975,7 @@ pub const Type = extern union {
49754975 var buf: Payload.ElemType = undefined;
49764976 const child_ty = ty.optionalChild(&buf);
49774977 if (child_ty.isNoReturn()) {
4978 return Value.@"null";
4978 return Value.null;
49794979 } else {
49804980 return null;
49814981 }
......@@ -5057,8 +5057,8 @@ pub const Type = extern union {
50575057 .empty_struct, .empty_struct_literal => return Value.initTag(.empty_struct_value),
50585058 .void => return Value.initTag(.void_value),
50595059 .noreturn => return Value.initTag(.unreachable_value),
5060 .@"null" => return Value.initTag(.null_value),
5061 .@"undefined" => return Value.initTag(.undef),
5060 .null => return Value.initTag(.null_value),
5061 .undefined => return Value.initTag(.undef),
50625062
50635063 .int_unsigned, .int_signed => {
50645064 if (ty.cast(Payload.Bits).?.data == 0) {
......@@ -5121,8 +5121,8 @@ pub const Type = extern union {
51215121 .anyerror,
51225122 .noreturn,
51235123 .@"anyframe",
5124 .@"null",
5125 .@"undefined",
5124 .null,
5125 .undefined,
51265126 .atomic_order,
51275127 .atomic_rmw_op,
51285128 .calling_convention,
......@@ -5937,8 +5937,8 @@ pub const Type = extern union {
59375937 comptime_float,
59385938 noreturn,
59395939 @"anyframe",
5940 @"null",
5941 @"undefined",
5940 null,
5941 undefined,
59425942 enum_literal,
59435943 atomic_order,
59445944 atomic_rmw_op,
......@@ -6062,8 +6062,8 @@ pub const Type = extern union {
60626062 .comptime_float,
60636063 .noreturn,
60646064 .enum_literal,
6065 .@"null",
6066 .@"undefined",
6065 .null,
6066 .undefined,
60676067 .fn_noreturn_no_args,
60686068 .fn_void_no_args,
60696069 .fn_naked_noreturn_no_args,
......@@ -6420,7 +6420,7 @@ pub const Type = extern union {
64206420 pub const @"type" = initTag(.type);
64216421 pub const @"anyerror" = initTag(.anyerror);
64226422 pub const @"anyopaque" = initTag(.anyopaque);
6423 pub const @"null" = initTag(.@"null");
6423 pub const @"null" = initTag(.null);
64246424
64256425 pub const err_int = Type.u16;
64266426
......@@ -6559,7 +6559,7 @@ pub const Type = extern union {
65596559 mod: *Module,
65606560 ) Allocator.Error!Type {
65616561 assert(error_set.zigTypeTag() == .ErrorSet);
6562 if (error_set.eql(Type.@"anyerror", mod) and
6562 if (error_set.eql(Type.anyerror, mod) and
65636563 payload.eql(Type.void, mod))
65646564 {
65656565 return Type.initTag(.anyerror_void_error_union);
src/value.zig+9-9
......@@ -941,8 +941,8 @@ pub const Value = extern union {
941941 .comptime_int_type => Type.initTag(.comptime_int),
942942 .comptime_float_type => Type.initTag(.comptime_float),
943943 .noreturn_type => Type.initTag(.noreturn),
944 .null_type => Type.initTag(.@"null"),
945 .undefined_type => Type.initTag(.@"undefined"),
944 .null_type => Type.initTag(.null),
945 .undefined_type => Type.initTag(.undefined),
946946 .fn_noreturn_no_args_type => Type.initTag(.fn_noreturn_no_args),
947947 .fn_void_no_args_type => Type.initTag(.fn_void_no_args),
948948 .fn_naked_noreturn_no_args_type => Type.initTag(.fn_naked_noreturn_no_args),
......@@ -1437,12 +1437,12 @@ pub const Value = extern union {
14371437 const target = mod.getTarget();
14381438 const endian = target.cpu.arch.endian();
14391439 switch (ty.zigTypeTag()) {
1440 .Void => return Value.@"void",
1440 .Void => return Value.void,
14411441 .Bool => {
14421442 if (buffer[0] == 0) {
1443 return Value.@"false";
1443 return Value.false;
14441444 } else {
1445 return Value.@"true";
1445 return Value.true;
14461446 }
14471447 },
14481448 .Int, .Enum => {
......@@ -1542,16 +1542,16 @@ pub const Value = extern union {
15421542 const target = mod.getTarget();
15431543 const endian = target.cpu.arch.endian();
15441544 switch (ty.zigTypeTag()) {
1545 .Void => return Value.@"void",
1545 .Void => return Value.void,
15461546 .Bool => {
15471547 const byte = switch (endian) {
15481548 .Big => buffer[buffer.len - bit_offset / 8 - 1],
15491549 .Little => buffer[bit_offset / 8],
15501550 };
15511551 if (((byte >> @intCast(u3, bit_offset % 8)) & 1) == 0) {
1552 return Value.@"false";
1552 return Value.false;
15531553 } else {
1554 return Value.@"true";
1554 return Value.true;
15551555 }
15561556 },
15571557 .Int, .Enum => {
......@@ -5279,7 +5279,7 @@ pub const Value = extern union {
52795279 pub const @"true" = initTag(.bool_true);
52805280
52815281 pub fn makeBool(x: bool) Value {
5282 return if (x) Value.@"true" else Value.@"false";
5282 return if (x) Value.true else Value.false;
52835283 }
52845284
52855285 pub const RuntimeIndex = enum(u32) {
test/behavior/bitcast.zig+1-1
......@@ -337,7 +337,7 @@ test "comptime @bitCast packed struct to int and back" {
337337 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
338338
339339 const S = packed struct {
340 @"void": void = {},
340 void: void = {},
341341 uint: u8 = 13,
342342 uint_bit_aligned: u3 = 2,
343343 iint_pos: i4 = 1,
tools/gen_spirv_spec.zig-1
......@@ -193,7 +193,6 @@ fn renderOpcodes(
193193 try renderOperand(writer, .instruction, inst.opname, inst.operands, extended_structs);
194194 }
195195 try writer.writeAll("};\n}\n};\n");
196 _ = extended_structs;
197196}
198197
199198fn renderOperandKinds(