| author | |
| committer | |
| log | 04f3067a7921a51bd55870f3138220fd66426e33 |
| tree | 158494e96381fe48304fef102d36a9431eef9642 |
| parent | e999f9f472f6b57214a8a66b69b8928ad28acbfe |
40 files changed, 292 insertions(+), 293 deletions(-)
lib/std/c/freebsd.zig+4-4| ... | ... | @@ -261,7 +261,7 @@ pub const Flock = extern struct { |
| 261 | 261 | /// Lock owner. |
| 262 | 262 | pid: pid_t, |
| 263 | 263 | /// Lock type. |
| 264 | @"type": i16, | |
| 264 | type: i16, | |
| 265 | 265 | /// Type of the start member. |
| 266 | 266 | whence: i16, |
| 267 | 267 | /// Remote system id or zero for local. |
| ... | ... | @@ -438,7 +438,7 @@ pub const kinfo_file = extern struct { |
| 438 | 438 | /// A zero value is for the sentinel record at the end of an array. |
| 439 | 439 | structsize: c_int, |
| 440 | 440 | /// Descriptor type. |
| 441 | @"type": c_int, | |
| 441 | type: c_int, | |
| 442 | 442 | /// Array index. |
| 443 | 443 | fd: fd_t, |
| 444 | 444 | /// Reference count. |
| ... | ... | @@ -456,7 +456,7 @@ pub const kinfo_file = extern struct { |
| 456 | 456 | /// Socket domain. |
| 457 | 457 | domain: c_int, |
| 458 | 458 | /// Socket type. |
| 459 | @"type": c_int, | |
| 459 | type: c_int, | |
| 460 | 460 | /// Socket protocol. |
| 461 | 461 | protocol: c_int, |
| 462 | 462 | /// Socket address. |
| ... | ... | @@ -478,7 +478,7 @@ pub const kinfo_file = extern struct { |
| 478 | 478 | }, |
| 479 | 479 | file: extern struct { |
| 480 | 480 | /// Vnode type. |
| 481 | @"type": i32, | |
| 481 | type: i32, | |
| 482 | 482 | // Reserved for future use |
| 483 | 483 | _spare1: [3]i32, |
| 484 | 484 | _spare2: [30]u64, |
lib/std/c/solaris.zig+6-6| ... | ... | @@ -24,20 +24,20 @@ pub const pthread_mutex_t = extern struct { |
| 24 | 24 | flag1: u16 = 0, |
| 25 | 25 | flag2: u8 = 0, |
| 26 | 26 | ceiling: u8 = 0, |
| 27 | @"type": u16 = 0, | |
| 27 | type: u16 = 0, | |
| 28 | 28 | magic: u16 = 0x4d58, |
| 29 | 29 | lock: u64 = 0, |
| 30 | 30 | data: u64 = 0, |
| 31 | 31 | }; |
| 32 | 32 | pub const pthread_cond_t = extern struct { |
| 33 | 33 | flag: [4]u8 = [_]u8{0} ** 4, |
| 34 | @"type": u16 = 0, | |
| 34 | type: u16 = 0, | |
| 35 | 35 | magic: u16 = 0x4356, |
| 36 | 36 | data: u64 = 0, |
| 37 | 37 | }; |
| 38 | 38 | pub const pthread_rwlock_t = extern struct { |
| 39 | 39 | readers: i32 = 0, |
| 40 | @"type": u16 = 0, | |
| 40 | type: u16 = 0, | |
| 41 | 41 | magic: u16 = 0x5257, |
| 42 | 42 | mutex: pthread_mutex_t = .{}, |
| 43 | 43 | readercv: pthread_cond_t = .{}, |
| ... | ... | @@ -50,7 +50,7 @@ pub const pthread_key_t = c_int; |
| 50 | 50 | |
| 51 | 51 | pub const sem_t = extern struct { |
| 52 | 52 | count: u32 = 0, |
| 53 | @"type": u16 = 0, | |
| 53 | type: u16 = 0, | |
| 54 | 54 | magic: u16 = 0x534d, |
| 55 | 55 | __pad1: [3]u64 = [_]u64{0} ** 3, |
| 56 | 56 | __pad2: [2]u64 = [_]u64{0} ** 2, |
| ... | ... | @@ -1683,7 +1683,7 @@ pub const _SC = struct { |
| 1683 | 1683 | pub const procfs = struct { |
| 1684 | 1684 | pub const misc_header = extern struct { |
| 1685 | 1685 | size: u32, |
| 1686 | @"type": enum(u32) { | |
| 1686 | type: enum(u32) { | |
| 1687 | 1687 | Pathname, |
| 1688 | 1688 | Socketname, |
| 1689 | 1689 | Peersockname, |
| ... | ... | @@ -1851,7 +1851,7 @@ pub const lifreq = extern struct { |
| 1851 | 1851 | ppa: u32, |
| 1852 | 1852 | }, |
| 1853 | 1853 | /// One of the IFT types, e.g. IFT_ETHER. |
| 1854 | @"type": u32, | |
| 1854 | type: u32, | |
| 1855 | 1855 | ifru: extern union { |
| 1856 | 1856 | /// Address. |
| 1857 | 1857 | addr: sockaddr.storage, |
lib/std/coff.zig+4-4| ... | ... | @@ -324,7 +324,7 @@ pub const BaseRelocation = packed struct { |
| 324 | 324 | offset: u12, |
| 325 | 325 | |
| 326 | 326 | /// 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, | |
| 328 | 328 | }; |
| 329 | 329 | |
| 330 | 330 | pub const BaseRelocationType = enum(u4) { |
| ... | ... | @@ -393,7 +393,7 @@ pub const DebugDirectoryEntry = extern struct { |
| 393 | 393 | time_date_stamp: u32, |
| 394 | 394 | major_version: u16, |
| 395 | 395 | minor_version: u16, |
| 396 | @"type": DebugType, | |
| 396 | type: DebugType, | |
| 397 | 397 | size_of_data: u32, |
| 398 | 398 | address_of_raw_data: u32, |
| 399 | 399 | pointer_to_raw_data: u32, |
| ... | ... | @@ -650,7 +650,7 @@ pub const Symbol = struct { |
| 650 | 650 | name: [8]u8, |
| 651 | 651 | value: u32, |
| 652 | 652 | section_number: SectionNumber, |
| 653 | @"type": SymType, | |
| 653 | type: SymType, | |
| 654 | 654 | storage_class: StorageClass, |
| 655 | 655 | number_of_aux_symbols: u8, |
| 656 | 656 | |
| ... | ... | @@ -1309,7 +1309,7 @@ pub const Symtab = struct { |
| 1309 | 1309 | .name = raw[0..8].*, |
| 1310 | 1310 | .value = mem.readIntLittle(u32, raw[8..12]), |
| 1311 | 1311 | .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])), | |
| 1313 | 1313 | .storage_class = @intToEnum(StorageClass, raw[16]), |
| 1314 | 1314 | .number_of_aux_symbols = raw[17], |
| 1315 | 1315 | }; |
lib/std/elf.zig+1-1| ... | ... | @@ -835,7 +835,7 @@ pub const Elf32_RegInfo = extern struct { |
| 835 | 835 | pub const Elf_Options = extern struct { |
| 836 | 836 | kind: u8, |
| 837 | 837 | size: u8, |
| 838 | @"section": Elf32_Section, | |
| 838 | section: Elf32_Section, | |
| 839 | 839 | info: Elf32_Word, |
| 840 | 840 | }; |
| 841 | 841 | pub const Elf_Options_Hw = extern struct { |
lib/std/fs/wasi.zig+7-7| ... | ... | @@ -80,13 +80,13 @@ pub const Preopen = struct { |
| 80 | 80 | fd: fd_t, |
| 81 | 81 | |
| 82 | 82 | /// Type of the preopen. |
| 83 | @"type": PreopenType, | |
| 83 | type: PreopenType, | |
| 84 | 84 | |
| 85 | 85 | /// Construct new `Preopen` instance. |
| 86 | 86 | pub fn new(fd: fd_t, preopen_type: PreopenType) Preopen { |
| 87 | 87 | return Preopen{ |
| 88 | 88 | .fd = fd, |
| 89 | .@"type" = preopen_type, | |
| 89 | .type = preopen_type, | |
| 90 | 90 | }; |
| 91 | 91 | } |
| 92 | 92 | }; |
| ... | ... | @@ -125,7 +125,7 @@ pub const PreopenList = struct { |
| 125 | 125 | /// Release all allocated memory. |
| 126 | 126 | pub fn deinit(pm: Self) void { |
| 127 | 127 | for (pm.buffer.items) |preopen| { |
| 128 | switch (preopen.@"type") { | |
| 128 | switch (preopen.type) { | |
| 129 | 129 | PreopenType.Dir => |path| pm.buffer.allocator.free(path), |
| 130 | 130 | } |
| 131 | 131 | } |
| ... | ... | @@ -161,7 +161,7 @@ pub const PreopenList = struct { |
| 161 | 161 | |
| 162 | 162 | // Clear contents if we're being called again |
| 163 | 163 | for (self.toOwnedSlice()) |preopen| { |
| 164 | switch (preopen.@"type") { | |
| 164 | switch (preopen.type) { | |
| 165 | 165 | PreopenType.Dir => |path| self.buffer.allocator.free(path), |
| 166 | 166 | } |
| 167 | 167 | } |
| ... | ... | @@ -226,7 +226,7 @@ pub const PreopenList = struct { |
| 226 | 226 | var best_match: ?PreopenUri = null; |
| 227 | 227 | |
| 228 | 228 | for (self.buffer.items) |preopen| { |
| 229 | if (preopen.@"type".getRelativePath(preopen_type)) |rel_path| { | |
| 229 | if (preopen.type.getRelativePath(preopen_type)) |rel_path| { | |
| 230 | 230 | if (best_match == null or rel_path.len <= best_match.?.relative_path.len) { |
| 231 | 231 | best_match = PreopenUri{ |
| 232 | 232 | .base = preopen, |
| ... | ... | @@ -253,7 +253,7 @@ pub const PreopenList = struct { |
| 253 | 253 | /// Otherwise, return `null`. |
| 254 | 254 | pub fn find(self: Self, preopen_type: PreopenType) ?*const Preopen { |
| 255 | 255 | for (self.buffer.items) |*preopen| { |
| 256 | if (preopen.@"type".eql(preopen_type)) { | |
| 256 | if (preopen.type.eql(preopen_type)) { | |
| 257 | 257 | return preopen; |
| 258 | 258 | } |
| 259 | 259 | } |
| ... | ... | @@ -280,7 +280,7 @@ test "extracting WASI preopens" { |
| 280 | 280 | try preopens.populate(null); |
| 281 | 281 | |
| 282 | 282 | 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 = "." })); | |
| 284 | 284 | |
| 285 | 285 | const po_type1 = PreopenType{ .Dir = "/" }; |
| 286 | 286 | 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 { |
| 700 | 700 | /// The format of the relocation entries referenced by the reloff and nreloc |
| 701 | 701 | /// fields of the section structure for mach object files is described in the |
| 702 | 702 | /// header file <reloc.h>. |
| 703 | pub const @"section" = extern struct { | |
| 703 | pub const section = extern struct { | |
| 704 | 704 | /// name of this section |
| 705 | 705 | sectname: [16]u8, |
| 706 | 706 | |
| ... | ... | @@ -794,12 +794,12 @@ pub const section_64 = extern struct { |
| 794 | 794 | } |
| 795 | 795 | |
| 796 | 796 | pub fn isZerofill(sect: section_64) bool { |
| 797 | const tt = sect.@"type"(); | |
| 797 | const tt = sect.type(); | |
| 798 | 798 | return tt == S_ZEROFILL or tt == S_GB_ZEROFILL or tt == S_THREAD_LOCAL_ZEROFILL; |
| 799 | 799 | } |
| 800 | 800 | |
| 801 | 801 | pub fn isSymbolStubs(sect: section_64) bool { |
| 802 | const tt = sect.@"type"(); | |
| 802 | const tt = sect.type(); | |
| 803 | 803 | return tt == S_SYMBOL_STUBS; |
| 804 | 804 | } |
| 805 | 805 | |
| ... | ... | @@ -1804,7 +1804,7 @@ pub const CodeDirectory = extern struct { |
| 1804 | 1804 | /// Structure of an embedded-signature SuperBlob |
| 1805 | 1805 | pub const BlobIndex = extern struct { |
| 1806 | 1806 | /// Type of entry |
| 1807 | @"type": u32, | |
| 1807 | type: u32, | |
| 1808 | 1808 | |
| 1809 | 1809 | /// Offset of entry |
| 1810 | 1810 | offset: u32, |
lib/std/os/linux.zig+5-5| ... | ... | @@ -3310,8 +3310,8 @@ pub const mmsghdr_const = extern struct { |
| 3310 | 3310 | pub const epoll_data = extern union { |
| 3311 | 3311 | ptr: usize, |
| 3312 | 3312 | fd: i32, |
| 3313 | @"u32": u32, | |
| 3314 | @"u64": u64, | |
| 3313 | u32: u32, | |
| 3314 | u64: u64, | |
| 3315 | 3315 | }; |
| 3316 | 3316 | |
| 3317 | 3317 | pub const epoll_event = switch (builtin.zig_backend) { |
| ... | ... | @@ -5124,7 +5124,7 @@ pub const nlmsghdr = extern struct { |
| 5124 | 5124 | len: u32, |
| 5125 | 5125 | |
| 5126 | 5126 | /// Message content |
| 5127 | @"type": NetlinkMessageType, | |
| 5127 | type: NetlinkMessageType, | |
| 5128 | 5128 | |
| 5129 | 5129 | /// Additional flags |
| 5130 | 5130 | flags: u16, |
| ... | ... | @@ -5141,7 +5141,7 @@ pub const ifinfomsg = extern struct { |
| 5141 | 5141 | __pad1: u8 = 0, |
| 5142 | 5142 | |
| 5143 | 5143 | /// ARPHRD_* |
| 5144 | @"type": c_ushort, | |
| 5144 | type: c_ushort, | |
| 5145 | 5145 | |
| 5146 | 5146 | /// Link index |
| 5147 | 5147 | index: c_int, |
| ... | ... | @@ -5158,7 +5158,7 @@ pub const rtattr = extern struct { |
| 5158 | 5158 | len: c_ushort, |
| 5159 | 5159 | |
| 5160 | 5160 | /// Type of option |
| 5161 | @"type": IFLA, | |
| 5161 | type: IFLA, | |
| 5162 | 5162 | |
| 5163 | 5163 | pub const ALIGNTO = 4; |
| 5164 | 5164 | }; |
lib/std/os/linux/sparc64.zig+1-1| ... | ... | @@ -435,7 +435,7 @@ pub const fpu_t = extern struct { |
| 435 | 435 | pub const mcontext_t = extern struct { |
| 436 | 436 | gregs: gregset_t, |
| 437 | 437 | fp: greg_t, |
| 438 | @"i7": greg_t, | |
| 438 | i7: greg_t, | |
| 439 | 439 | fpregs: fpu_t, |
| 440 | 440 | }; |
| 441 | 441 |
lib/std/os/wasi.zig+1-1| ... | ... | @@ -279,7 +279,7 @@ pub const E = errno_t; |
| 279 | 279 | pub const event_t = extern struct { |
| 280 | 280 | userdata: userdata_t, |
| 281 | 281 | @"error": errno_t, |
| 282 | @"type": eventtype_t, | |
| 282 | type: eventtype_t, | |
| 283 | 283 | fd_readwrite: eventfdreadwrite_t, |
| 284 | 284 | }; |
| 285 | 285 |
lib/std/zig/system/linux.zig+11-11| ... | ... | @@ -84,20 +84,20 @@ const PowerpcCpuinfoImpl = struct { |
| 84 | 84 | .{ "7410", &Target.powerpc.cpu.@"7400" }, |
| 85 | 85 | .{ "7447", &Target.powerpc.cpu.@"7400" }, |
| 86 | 86 | .{ "7455", &Target.powerpc.cpu.@"7450" }, |
| 87 | .{ "G4", &Target.powerpc.cpu.@"g4" }, | |
| 87 | .{ "G4", &Target.powerpc.cpu.g4 }, | |
| 88 | 88 | .{ "POWER4", &Target.powerpc.cpu.@"970" }, |
| 89 | 89 | .{ "PPC970FX", &Target.powerpc.cpu.@"970" }, |
| 90 | 90 | .{ "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 }, | |
| 101 | 101 | }; |
| 102 | 102 | |
| 103 | 103 | fn line_hook(self: *PowerpcCpuinfoImpl, key: []const u8, value: []const u8) !bool { |
src/AstGen.zig+20-20| ... | ... | @@ -2868,7 +2868,7 @@ fn deferStmt( |
| 2868 | 2868 | .name = ident_name, |
| 2869 | 2869 | .inst = remapped_err_code_ref, |
| 2870 | 2870 | .token_src = payload_token, |
| 2871 | .id_cat = .@"capture", | |
| 2871 | .id_cat = .capture, | |
| 2872 | 2872 | }; |
| 2873 | 2873 | try gz.addDbgVar(.dbg_var_val, ident_name, remapped_err_code_ref); |
| 2874 | 2874 | break :blk &local_val_scope.base; |
| ... | ... | @@ -5353,7 +5353,7 @@ fn orelseCatchExpr( |
| 5353 | 5353 | } |
| 5354 | 5354 | const err_name = try astgen.identAsString(payload); |
| 5355 | 5355 | |
| 5356 | try astgen.detectLocalShadowing(scope, err_name, payload, err_str, .@"capture"); | |
| 5356 | try astgen.detectLocalShadowing(scope, err_name, payload, err_str, .capture); | |
| 5357 | 5357 | |
| 5358 | 5358 | err_val_scope = .{ |
| 5359 | 5359 | .parent = &else_scope.base, |
| ... | ... | @@ -5361,7 +5361,7 @@ fn orelseCatchExpr( |
| 5361 | 5361 | .name = err_name, |
| 5362 | 5362 | .inst = try else_scope.addUnNode(unwrap_code_op, operand, node), |
| 5363 | 5363 | .token_src = payload, |
| 5364 | .id_cat = .@"capture", | |
| 5364 | .id_cat = .capture, | |
| 5365 | 5365 | }; |
| 5366 | 5366 | break :blk &err_val_scope.base; |
| 5367 | 5367 | }; |
| ... | ... | @@ -5698,14 +5698,14 @@ fn ifExpr( |
| 5698 | 5698 | const token_name_str = tree.tokenSlice(token_name_index); |
| 5699 | 5699 | if (mem.eql(u8, "_", token_name_str)) |
| 5700 | 5700 | 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); | |
| 5702 | 5702 | payload_val_scope = .{ |
| 5703 | 5703 | .parent = &then_scope.base, |
| 5704 | 5704 | .gen_zir = &then_scope, |
| 5705 | 5705 | .name = ident_name, |
| 5706 | 5706 | .inst = payload_inst, |
| 5707 | 5707 | .token_src = payload_token, |
| 5708 | .id_cat = .@"capture", | |
| 5708 | .id_cat = .capture, | |
| 5709 | 5709 | }; |
| 5710 | 5710 | try then_scope.addDbgVar(.dbg_var_val, ident_name, payload_inst); |
| 5711 | 5711 | break :s &payload_val_scope.base; |
| ... | ... | @@ -5724,14 +5724,14 @@ fn ifExpr( |
| 5724 | 5724 | break :s &then_scope.base; |
| 5725 | 5725 | const payload_inst = try then_scope.addUnNode(tag, cond.inst, if_full.ast.then_expr); |
| 5726 | 5726 | 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); | |
| 5728 | 5728 | payload_val_scope = .{ |
| 5729 | 5729 | .parent = &then_scope.base, |
| 5730 | 5730 | .gen_zir = &then_scope, |
| 5731 | 5731 | .name = ident_name, |
| 5732 | 5732 | .inst = payload_inst, |
| 5733 | 5733 | .token_src = ident_token, |
| 5734 | .id_cat = .@"capture", | |
| 5734 | .id_cat = .capture, | |
| 5735 | 5735 | }; |
| 5736 | 5736 | try then_scope.addDbgVar(.dbg_var_val, ident_name, payload_inst); |
| 5737 | 5737 | break :s &payload_val_scope.base; |
| ... | ... | @@ -5775,14 +5775,14 @@ fn ifExpr( |
| 5775 | 5775 | const error_token_str = tree.tokenSlice(error_token); |
| 5776 | 5776 | if (mem.eql(u8, "_", error_token_str)) |
| 5777 | 5777 | 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); | |
| 5779 | 5779 | payload_val_scope = .{ |
| 5780 | 5780 | .parent = &else_scope.base, |
| 5781 | 5781 | .gen_zir = &else_scope, |
| 5782 | 5782 | .name = ident_name, |
| 5783 | 5783 | .inst = payload_inst, |
| 5784 | 5784 | .token_src = error_token, |
| 5785 | .id_cat = .@"capture", | |
| 5785 | .id_cat = .capture, | |
| 5786 | 5786 | }; |
| 5787 | 5787 | try else_scope.addDbgVar(.dbg_var_val, ident_name, payload_inst); |
| 5788 | 5788 | break :s &payload_val_scope.base; |
| ... | ... | @@ -6045,14 +6045,14 @@ fn whileExpr( |
| 6045 | 6045 | break :s &then_scope.base; |
| 6046 | 6046 | const payload_name_loc = payload_token + @boolToInt(payload_is_ref); |
| 6047 | 6047 | 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); | |
| 6049 | 6049 | payload_val_scope = .{ |
| 6050 | 6050 | .parent = &then_scope.base, |
| 6051 | 6051 | .gen_zir = &then_scope, |
| 6052 | 6052 | .name = ident_name, |
| 6053 | 6053 | .inst = indexToRef(payload_inst), |
| 6054 | 6054 | .token_src = payload_token, |
| 6055 | .id_cat = .@"capture", | |
| 6055 | .id_cat = .capture, | |
| 6056 | 6056 | }; |
| 6057 | 6057 | dbg_var_name = ident_name; |
| 6058 | 6058 | dbg_var_inst = indexToRef(payload_inst); |
| ... | ... | @@ -6073,14 +6073,14 @@ fn whileExpr( |
| 6073 | 6073 | const ident_bytes = tree.tokenSlice(ident_token); |
| 6074 | 6074 | if (mem.eql(u8, "_", ident_bytes)) |
| 6075 | 6075 | 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); | |
| 6077 | 6077 | payload_val_scope = .{ |
| 6078 | 6078 | .parent = &then_scope.base, |
| 6079 | 6079 | .gen_zir = &then_scope, |
| 6080 | 6080 | .name = ident_name, |
| 6081 | 6081 | .inst = indexToRef(payload_inst), |
| 6082 | 6082 | .token_src = ident_token, |
| 6083 | .id_cat = .@"capture", | |
| 6083 | .id_cat = .capture, | |
| 6084 | 6084 | }; |
| 6085 | 6085 | dbg_var_name = ident_name; |
| 6086 | 6086 | dbg_var_inst = indexToRef(payload_inst); |
| ... | ... | @@ -6154,14 +6154,14 @@ fn whileExpr( |
| 6154 | 6154 | const ident_bytes = tree.tokenSlice(error_token); |
| 6155 | 6155 | if (mem.eql(u8, ident_bytes, "_")) |
| 6156 | 6156 | 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); | |
| 6158 | 6158 | payload_val_scope = .{ |
| 6159 | 6159 | .parent = &else_scope.base, |
| 6160 | 6160 | .gen_zir = &else_scope, |
| 6161 | 6161 | .name = ident_name, |
| 6162 | 6162 | .inst = else_payload_inst, |
| 6163 | 6163 | .token_src = error_token, |
| 6164 | .id_cat = .@"capture", | |
| 6164 | .id_cat = .capture, | |
| 6165 | 6165 | }; |
| 6166 | 6166 | try else_scope.addDbgVar(.dbg_var_val, ident_name, else_payload_inst); |
| 6167 | 6167 | break :s &payload_val_scope.base; |
| ... | ... | @@ -6326,14 +6326,14 @@ fn forExpr( |
| 6326 | 6326 | .lhs = array_ptr, |
| 6327 | 6327 | .rhs = index, |
| 6328 | 6328 | }); |
| 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); | |
| 6330 | 6330 | payload_val_scope = .{ |
| 6331 | 6331 | .parent = &then_scope.base, |
| 6332 | 6332 | .gen_zir = &then_scope, |
| 6333 | 6333 | .name = name_str_index, |
| 6334 | 6334 | .inst = payload_inst, |
| 6335 | 6335 | .token_src = ident, |
| 6336 | .id_cat = .@"capture", | |
| 6336 | .id_cat = .capture, | |
| 6337 | 6337 | }; |
| 6338 | 6338 | try then_scope.addDbgVar(.dbg_var_val, name_str_index, payload_inst); |
| 6339 | 6339 | payload_sub_scope = &payload_val_scope.base; |
| ... | ... | @@ -6672,14 +6672,14 @@ fn switchExpr( |
| 6672 | 6672 | }); |
| 6673 | 6673 | } |
| 6674 | 6674 | 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); | |
| 6676 | 6676 | capture_val_scope = .{ |
| 6677 | 6677 | .parent = &case_scope.base, |
| 6678 | 6678 | .gen_zir = &case_scope, |
| 6679 | 6679 | .name = capture_name, |
| 6680 | 6680 | .inst = indexToRef(capture_inst), |
| 6681 | 6681 | .token_src = payload_token, |
| 6682 | .id_cat = .@"capture", | |
| 6682 | .id_cat = .capture, | |
| 6683 | 6683 | }; |
| 6684 | 6684 | dbg_var_name = capture_name; |
| 6685 | 6685 | dbg_var_inst = indexToRef(capture_inst); |
| ... | ... | @@ -10453,7 +10453,7 @@ const Scope = struct { |
| 10453 | 10453 | @"local variable", |
| 10454 | 10454 | @"loop index capture", |
| 10455 | 10455 | @"switch tag capture", |
| 10456 | @"capture", | |
| 10456 | capture, | |
| 10457 | 10457 | }; |
| 10458 | 10458 | |
| 10459 | 10459 | /// 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 { |
| 660 | 660 | comptimeExpr: usize, // index in `comptimeExprs` |
| 661 | 661 | void: struct {}, |
| 662 | 662 | @"unreachable": struct {}, |
| 663 | @"null": struct {}, | |
| 664 | @"undefined": struct {}, | |
| 663 | null: struct {}, | |
| 664 | undefined: struct {}, | |
| 665 | 665 | @"struct": []FieldVal, |
| 666 | 666 | bool: bool, |
| 667 | 667 | @"anytype": struct {}, |
| ... | ... | @@ -4217,7 +4217,7 @@ fn walkRef( |
| 4217 | 4217 | ); |
| 4218 | 4218 | }, |
| 4219 | 4219 | .undef => { |
| 4220 | return DocData.WalkResult{ .expr = .@"undefined" }; | |
| 4220 | return DocData.WalkResult{ .expr = .undefined }; | |
| 4221 | 4221 | }, |
| 4222 | 4222 | .zero => { |
| 4223 | 4223 | return DocData.WalkResult{ |
| ... | ... | @@ -4245,7 +4245,7 @@ fn walkRef( |
| 4245 | 4245 | }; |
| 4246 | 4246 | }, |
| 4247 | 4247 | .null_value => { |
| 4248 | return DocData.WalkResult{ .expr = .@"null" }; | |
| 4248 | return DocData.WalkResult{ .expr = .null }; | |
| 4249 | 4249 | }, |
| 4250 | 4250 | .bool_true => { |
| 4251 | 4251 | return DocData.WalkResult{ |
src/InternPool.zig+2-2| ... | ... | @@ -168,9 +168,9 @@ pub const Simple = enum(u32) { |
| 168 | 168 | null_type, |
| 169 | 169 | undefined_type, |
| 170 | 170 | enum_literal_type, |
| 171 | @"undefined", | |
| 171 | undefined, | |
| 172 | 172 | void_value, |
| 173 | @"null", | |
| 173 | null, | |
| 174 | 174 | bool_true, |
| 175 | 175 | bool_false, |
| 176 | 176 | }; |
src/Sema.zig+51-51| ... | ... | @@ -1716,7 +1716,7 @@ fn analyzeAsType( |
| 1716 | 1716 | src: LazySrcLoc, |
| 1717 | 1717 | air_inst: Air.Inst.Ref, |
| 1718 | 1718 | ) !Type { |
| 1719 | const wanted_type = Type.initTag(.@"type"); | |
| 1719 | const wanted_type = Type.initTag(.type); | |
| 1720 | 1720 | const coerced_inst = try sema.coerce(block, wanted_type, air_inst, src); |
| 1721 | 1721 | const val = try sema.resolveConstValue(block, src, coerced_inst, "types must be comptime-known"); |
| 1722 | 1722 | var buffer: Value.ToTypeBuffer = undefined; |
| ... | ... | @@ -2396,9 +2396,9 @@ fn coerceResultPtr( |
| 2396 | 2396 | if (try sema.resolveDefinedValue(block, src, new_ptr)) |ptr_val| { |
| 2397 | 2397 | return sema.addConstant(ptr_ty, ptr_val); |
| 2398 | 2398 | } |
| 2399 | if (pointee_ty.eql(Type.@"null", sema.mod)) { | |
| 2399 | if (pointee_ty.eql(Type.null, sema.mod)) { | |
| 2400 | 2400 | 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); | |
| 2402 | 2402 | _ = try block.addBinOp(.store, new_ptr, null_inst); |
| 2403 | 2403 | return Air.Inst.Ref.void_value; |
| 2404 | 2404 | } |
| ... | ... | @@ -2691,7 +2691,7 @@ fn zirEnumDecl( |
| 2691 | 2691 | |
| 2692 | 2692 | enum_obj.* = .{ |
| 2693 | 2693 | .owner_decl = new_decl_index, |
| 2694 | .tag_ty = Type.@"null", | |
| 2694 | .tag_ty = Type.null, | |
| 2695 | 2695 | .tag_ty_inferred = true, |
| 2696 | 2696 | .fields = .{}, |
| 2697 | 2697 | .values = .{}, |
| ... | ... | @@ -2962,7 +2962,7 @@ fn zirUnionDecl( |
| 2962 | 2962 | errdefer mod.abortAnonDecl(new_decl_index); |
| 2963 | 2963 | union_obj.* = .{ |
| 2964 | 2964 | .owner_decl = new_decl_index, |
| 2965 | .tag_ty = Type.initTag(.@"null"), | |
| 2965 | .tag_ty = Type.initTag(.null), | |
| 2966 | 2966 | .fields = .{}, |
| 2967 | 2967 | .zir_index = inst, |
| 2968 | 2968 | .layout = small.layout, |
| ... | ... | @@ -9885,7 +9885,7 @@ fn zirSwitchBlock(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError |
| 9885 | 9885 | .{}, |
| 9886 | 9886 | ); |
| 9887 | 9887 | } |
| 9888 | else_error_ty = Type.@"anyerror"; | |
| 9888 | else_error_ty = Type.anyerror; | |
| 9889 | 9889 | } else else_validation: { |
| 9890 | 9890 | var maybe_msg: ?*Module.ErrorMsg = null; |
| 9891 | 9891 | errdefer if (maybe_msg) |msg| msg.destroy(sema.gpa); |
| ... | ... | @@ -11558,7 +11558,7 @@ fn zirShl( |
| 11558 | 11558 | }) |
| 11559 | 11559 | else |
| 11560 | 11560 | ov_bit; |
| 11561 | const zero_ov = try sema.addConstant(Type.@"u1", Value.zero); | |
| 11561 | const zero_ov = try sema.addConstant(Type.u1, Value.zero); | |
| 11562 | 11562 | const no_ov = try block.addBinOp(.cmp_eq, any_ov_bit, zero_ov); |
| 11563 | 11563 | |
| 11564 | 11564 | try sema.addSafetyCheck(block, no_ov, .shl_overflow); |
| ... | ... | @@ -13452,7 +13452,7 @@ fn zirOverflowArithmetic( |
| 13452 | 13452 | const ov_ty = tuple_ty.tupleFields().types[1]; |
| 13453 | 13453 | // TODO: Remove and use `ov_ty` instead. |
| 13454 | 13454 | // 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; | |
| 13456 | 13456 | |
| 13457 | 13457 | const result: struct { |
| 13458 | 13458 | /// TODO: Rename to `overflow_bit` and make of type `u1`. |
| ... | ... | @@ -13615,7 +13615,7 @@ fn zirOverflowArithmetic( |
| 13615 | 13615 | } |
| 13616 | 13616 | |
| 13617 | 13617 | fn 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; | |
| 13619 | 13619 | |
| 13620 | 13620 | const types = try sema.arena.alloc(Type, 2); |
| 13621 | 13621 | const values = try sema.arena.alloc(Value, 2); |
| ... | ... | @@ -14075,7 +14075,7 @@ fn analyzeArithmetic( |
| 14075 | 14075 | }) |
| 14076 | 14076 | else |
| 14077 | 14077 | ov_bit; |
| 14078 | const zero_ov = try sema.addConstant(Type.@"u1", Value.zero); | |
| 14078 | const zero_ov = try sema.addConstant(Type.u1, Value.zero); | |
| 14079 | 14079 | const no_ov = try block.addBinOp(.cmp_eq, any_ov_bit, zero_ov); |
| 14080 | 14080 | |
| 14081 | 14081 | try sema.addSafetyCheck(block, no_ov, .integer_overflow); |
| ... | ... | @@ -14569,7 +14569,7 @@ fn cmpSelf( |
| 14569 | 14569 | if (rhs_val.isUndef()) return sema.addConstUndef(Type.bool); |
| 14570 | 14570 | |
| 14571 | 14571 | 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); | |
| 14573 | 14573 | const cmp_val = try sema.compareVector(lhs_val, op, rhs_val, resolved_type); |
| 14574 | 14574 | return sema.addConstant(result_ty, cmp_val); |
| 14575 | 14575 | } |
| ... | ... | @@ -14600,7 +14600,7 @@ fn cmpSelf( |
| 14600 | 14600 | }; |
| 14601 | 14601 | try sema.requireRuntimeBlock(block, src, runtime_src); |
| 14602 | 14602 | 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); | |
| 14604 | 14604 | const result_ty_ref = try sema.addType(result_ty); |
| 14605 | 14605 | return block.addCmpVector(casted_lhs, casted_rhs, op, result_ty_ref); |
| 14606 | 14606 | } |
| ... | ... | @@ -14932,63 +14932,63 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 14932 | 14932 | type_info_ty, |
| 14933 | 14933 | try Value.Tag.@"union".create(sema.arena, .{ |
| 14934 | 14934 | .tag = try Value.Tag.enum_field_index.create(sema.arena, @enumToInt(std.builtin.TypeId.Type)), |
| 14935 | .val = Value.@"void", | |
| 14935 | .val = Value.void, | |
| 14936 | 14936 | }), |
| 14937 | 14937 | ), |
| 14938 | 14938 | .Void => return sema.addConstant( |
| 14939 | 14939 | type_info_ty, |
| 14940 | 14940 | try Value.Tag.@"union".create(sema.arena, .{ |
| 14941 | 14941 | .tag = try Value.Tag.enum_field_index.create(sema.arena, @enumToInt(std.builtin.TypeId.Void)), |
| 14942 | .val = Value.@"void", | |
| 14942 | .val = Value.void, | |
| 14943 | 14943 | }), |
| 14944 | 14944 | ), |
| 14945 | 14945 | .Bool => return sema.addConstant( |
| 14946 | 14946 | type_info_ty, |
| 14947 | 14947 | try Value.Tag.@"union".create(sema.arena, .{ |
| 14948 | 14948 | .tag = try Value.Tag.enum_field_index.create(sema.arena, @enumToInt(std.builtin.TypeId.Bool)), |
| 14949 | .val = Value.@"void", | |
| 14949 | .val = Value.void, | |
| 14950 | 14950 | }), |
| 14951 | 14951 | ), |
| 14952 | 14952 | .NoReturn => return sema.addConstant( |
| 14953 | 14953 | type_info_ty, |
| 14954 | 14954 | try Value.Tag.@"union".create(sema.arena, .{ |
| 14955 | 14955 | .tag = try Value.Tag.enum_field_index.create(sema.arena, @enumToInt(std.builtin.TypeId.NoReturn)), |
| 14956 | .val = Value.@"void", | |
| 14956 | .val = Value.void, | |
| 14957 | 14957 | }), |
| 14958 | 14958 | ), |
| 14959 | 14959 | .ComptimeFloat => return sema.addConstant( |
| 14960 | 14960 | type_info_ty, |
| 14961 | 14961 | try Value.Tag.@"union".create(sema.arena, .{ |
| 14962 | 14962 | .tag = try Value.Tag.enum_field_index.create(sema.arena, @enumToInt(std.builtin.TypeId.ComptimeFloat)), |
| 14963 | .val = Value.@"void", | |
| 14963 | .val = Value.void, | |
| 14964 | 14964 | }), |
| 14965 | 14965 | ), |
| 14966 | 14966 | .ComptimeInt => return sema.addConstant( |
| 14967 | 14967 | type_info_ty, |
| 14968 | 14968 | try Value.Tag.@"union".create(sema.arena, .{ |
| 14969 | 14969 | .tag = try Value.Tag.enum_field_index.create(sema.arena, @enumToInt(std.builtin.TypeId.ComptimeInt)), |
| 14970 | .val = Value.@"void", | |
| 14970 | .val = Value.void, | |
| 14971 | 14971 | }), |
| 14972 | 14972 | ), |
| 14973 | 14973 | .Undefined => return sema.addConstant( |
| 14974 | 14974 | type_info_ty, |
| 14975 | 14975 | try Value.Tag.@"union".create(sema.arena, .{ |
| 14976 | 14976 | .tag = try Value.Tag.enum_field_index.create(sema.arena, @enumToInt(std.builtin.TypeId.Undefined)), |
| 14977 | .val = Value.@"void", | |
| 14977 | .val = Value.void, | |
| 14978 | 14978 | }), |
| 14979 | 14979 | ), |
| 14980 | 14980 | .Null => return sema.addConstant( |
| 14981 | 14981 | type_info_ty, |
| 14982 | 14982 | try Value.Tag.@"union".create(sema.arena, .{ |
| 14983 | 14983 | .tag = try Value.Tag.enum_field_index.create(sema.arena, @enumToInt(std.builtin.TypeId.Null)), |
| 14984 | .val = Value.@"void", | |
| 14984 | .val = Value.void, | |
| 14985 | 14985 | }), |
| 14986 | 14986 | ), |
| 14987 | 14987 | .EnumLiteral => return sema.addConstant( |
| 14988 | 14988 | type_info_ty, |
| 14989 | 14989 | try Value.Tag.@"union".create(sema.arena, .{ |
| 14990 | 14990 | .tag = try Value.Tag.enum_field_index.create(sema.arena, @enumToInt(std.builtin.TypeId.EnumLiteral)), |
| 14991 | .val = Value.@"void", | |
| 14991 | .val = Value.void, | |
| 14992 | 14992 | }), |
| 14993 | 14993 | ), |
| 14994 | 14994 | .Fn => { |
| ... | ... | @@ -15003,7 +15003,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 15003 | 15003 | const param_ty = info.param_types[i]; |
| 15004 | 15004 | const is_generic = param_ty.tag() == .generic_poison; |
| 15005 | 15005 | const param_ty_val = if (is_generic) |
| 15006 | Value.@"null" | |
| 15006 | Value.null | |
| 15007 | 15007 | else |
| 15008 | 15008 | try Value.Tag.opt_payload.create( |
| 15009 | 15009 | params_anon_decl.arena(), |
| ... | ... | @@ -15015,7 +15015,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 15015 | 15015 | // is_generic: bool, |
| 15016 | 15016 | Value.makeBool(is_generic), |
| 15017 | 15017 | // is_noalias: bool, |
| 15018 | Value.@"false", // TODO | |
| 15018 | Value.false, // TODO | |
| 15019 | 15019 | // arg_type: ?type, |
| 15020 | 15020 | param_ty_val, |
| 15021 | 15021 | }; |
| ... | ... | @@ -15068,7 +15068,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 15068 | 15068 | try Value.Tag.ty.create(sema.arena, info.return_type), |
| 15069 | 15069 | ) |
| 15070 | 15070 | else |
| 15071 | Value.@"null"; | |
| 15071 | Value.null; | |
| 15072 | 15072 | |
| 15073 | 15073 | const field_values = try sema.arena.create([6]Value); |
| 15074 | 15074 | field_values.* = .{ |
| ... | ... | @@ -15287,7 +15287,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 15287 | 15287 | .len = try Value.Tag.int_u64.create(sema.arena, vals.len), |
| 15288 | 15288 | }); |
| 15289 | 15289 | break :v try Value.Tag.opt_payload.create(sema.arena, slice_val); |
| 15290 | } else Value.@"null"; | |
| 15290 | } else Value.null; | |
| 15291 | 15291 | |
| 15292 | 15292 | // Construct Type{ .ErrorSet = errors_val } |
| 15293 | 15293 | return sema.addConstant( |
| ... | ... | @@ -15498,7 +15498,7 @@ fn zirTypeInfo(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai |
| 15498 | 15498 | const enum_tag_ty_val = if (union_ty.unionTagType()) |tag_ty| v: { |
| 15499 | 15499 | const ty_val = try Value.Tag.ty.create(sema.arena, tag_ty); |
| 15500 | 15500 | break :v try Value.Tag.opt_payload.create(sema.arena, ty_val); |
| 15501 | } else Value.@"null"; | |
| 15501 | } else Value.null; | |
| 15502 | 15502 | |
| 15503 | 15503 | const field_values = try sema.arena.create([4]Value); |
| 15504 | 15504 | field_values.* = .{ |
| ... | ... | @@ -15848,7 +15848,7 @@ fn zirLog2IntType(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError |
| 15848 | 15848 | |
| 15849 | 15849 | fn log2IntType(sema: *Sema, block: *Block, operand: Type, src: LazySrcLoc) CompileError!Type { |
| 15850 | 15850 | switch (operand.zigTypeTag()) { |
| 15851 | .ComptimeInt => return Type.@"comptime_int", | |
| 15851 | .ComptimeInt => return Type.comptime_int, | |
| 15852 | 15852 | .Int => { |
| 15853 | 15853 | const bits = operand.bitSize(sema.mod.getTarget()); |
| 15854 | 15854 | const count = if (bits == 0) |
| ... | ... | @@ -17518,7 +17518,7 @@ fn getErrorReturnTrace(sema: *Sema, block: *Block) CompileError!Air.Inst.Ref { |
| 17518 | 17518 | { |
| 17519 | 17519 | return block.addTy(.err_return_trace, opt_ptr_stack_trace_ty); |
| 17520 | 17520 | } |
| 17521 | return sema.addConstant(opt_ptr_stack_trace_ty, Value.@"null"); | |
| 17521 | return sema.addConstant(opt_ptr_stack_trace_ty, Value.null); | |
| 17522 | 17522 | } |
| 17523 | 17523 | |
| 17524 | 17524 | fn zirFrame( |
| ... | ... | @@ -17760,11 +17760,11 @@ fn zirReify(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstData, in |
| 17760 | 17760 | |
| 17761 | 17761 | const bits = @intCast(u16, bits_val.toUnsignedInt(target)); |
| 17762 | 17762 | 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, | |
| 17768 | 17768 | else => return sema.fail(block, src, "{}-bit float unsupported", .{bits}), |
| 17769 | 17769 | }; |
| 17770 | 17770 | return sema.addType(ty); |
| ... | ... | @@ -18029,7 +18029,7 @@ fn zirReify(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstData, in |
| 18029 | 18029 | |
| 18030 | 18030 | enum_obj.* = .{ |
| 18031 | 18031 | .owner_decl = new_decl_index, |
| 18032 | .tag_ty = Type.@"null", | |
| 18032 | .tag_ty = Type.null, | |
| 18033 | 18033 | .tag_ty_inferred = false, |
| 18034 | 18034 | .fields = .{}, |
| 18035 | 18035 | .values = .{}, |
| ... | ... | @@ -18077,7 +18077,7 @@ fn zirReify(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstData, in |
| 18077 | 18077 | // TODO: better source location |
| 18078 | 18078 | return sema.fail(block, src, "field '{s}' with enumeration value '{}' is too large for backing int type '{}'", .{ |
| 18079 | 18079 | field_name, |
| 18080 | value_val.fmtValue(Type.@"comptime_int", mod), | |
| 18080 | value_val.fmtValue(Type.comptime_int, mod), | |
| 18081 | 18081 | enum_obj.tag_ty.fmt(mod), |
| 18082 | 18082 | }); |
| 18083 | 18083 | } |
| ... | ... | @@ -18187,7 +18187,7 @@ fn zirReify(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstData, in |
| 18187 | 18187 | errdefer mod.abortAnonDecl(new_decl_index); |
| 18188 | 18188 | union_obj.* = .{ |
| 18189 | 18189 | .owner_decl = new_decl_index, |
| 18190 | .tag_ty = Type.initTag(.@"null"), | |
| 18190 | .tag_ty = Type.initTag(.null), | |
| 18191 | 18191 | .fields = .{}, |
| 18192 | 18192 | .zir_index = inst, |
| 18193 | 18193 | .layout = layout, |
| ... | ... | @@ -19918,7 +19918,7 @@ fn zirCmpxchg( |
| 19918 | 19918 | |
| 19919 | 19919 | // special case zero bit types |
| 19920 | 19920 | if ((try sema.typeHasOnePossibleValue(elem_ty)) != null) { |
| 19921 | return sema.addConstant(result_ty, Value.@"null"); | |
| 19921 | return sema.addConstant(result_ty, Value.null); | |
| 19922 | 19922 | } |
| 19923 | 19923 | |
| 19924 | 19924 | const runtime_src = if (try sema.resolveDefinedValue(block, ptr_src, ptr)) |ptr_val| rs: { |
| ... | ... | @@ -19933,7 +19933,7 @@ fn zirCmpxchg( |
| 19933 | 19933 | const stored_val = (try sema.pointerDeref(block, ptr_src, ptr_val, ptr_ty)) orelse break :rs ptr_src; |
| 19934 | 19934 | const result_val = if (stored_val.eql(expected_val, elem_ty, sema.mod)) blk: { |
| 19935 | 19935 | try sema.storePtr(block, src, ptr, new_value); |
| 19936 | break :blk Value.@"null"; | |
| 19936 | break :blk Value.null; | |
| 19937 | 19937 | } else try Value.Tag.opt_payload.create(sema.arena, stored_val); |
| 19938 | 19938 | |
| 19939 | 19939 | return sema.addConstant(result_ty, result_val); |
| ... | ... | @@ -20074,7 +20074,7 @@ fn zirShuffle(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air |
| 20074 | 20074 | }; |
| 20075 | 20075 | mask_ty = try Type.Tag.vector.create(sema.arena, .{ |
| 20076 | 20076 | .len = mask_len, |
| 20077 | .elem_type = Type.@"i32", | |
| 20077 | .elem_type = Type.i32, | |
| 20078 | 20078 | }); |
| 20079 | 20079 | mask = try sema.coerce(block, mask_ty, mask, mask_src); |
| 20080 | 20080 | const mask_val = try sema.resolveConstMaybeUndefVal(block, mask_src, mask, "shuffle mask must be comptime-known"); |
| ... | ... | @@ -22133,7 +22133,7 @@ fn panicWithMsg( |
| 22133 | 22133 | }); |
| 22134 | 22134 | const null_stack_trace = try sema.addConstant( |
| 22135 | 22135 | try Type.optional(arena, ptr_stack_trace_ty), |
| 22136 | Value.@"null", | |
| 22136 | Value.null, | |
| 22137 | 22137 | ); |
| 22138 | 22138 | const args: [3]Air.Inst.Ref = .{ msg_inst, null_stack_trace, .null_value }; |
| 22139 | 22139 | _ = try sema.analyzeCall(block, panic_fn, src, src, .auto, false, &args, null); |
| ... | ... | @@ -23976,7 +23976,7 @@ fn coerceExtra( |
| 23976 | 23976 | |
| 23977 | 23977 | // null to ?T |
| 23978 | 23978 | if (inst_ty.zigTypeTag() == .Null) { |
| 23979 | return sema.addConstant(dest_ty, Value.@"null"); | |
| 23979 | return sema.addConstant(dest_ty, Value.null); | |
| 23980 | 23980 | } |
| 23981 | 23981 | |
| 23982 | 23982 | // cast from ?*T and ?[*]T to ?*anyopaque |
| ... | ... | @@ -24135,7 +24135,7 @@ fn coerceExtra( |
| 24135 | 24135 | // coercion to C pointer |
| 24136 | 24136 | .C => switch (inst_ty.zigTypeTag()) { |
| 24137 | 24137 | .Null => { |
| 24138 | return sema.addConstant(dest_ty, Value.@"null"); | |
| 24138 | return sema.addConstant(dest_ty, Value.null); | |
| 24139 | 24139 | }, |
| 24140 | 24140 | .ComptimeInt => { |
| 24141 | 24141 | 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 { |
| 27361 | 27361 | } |
| 27362 | 27362 | |
| 27363 | 27363 | fn 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; | |
| 27365 | 27365 | const ptr_val = try sema.refValue(block, ty, val); |
| 27366 | 27366 | const result = try Value.Tag.opt_payload.create(sema.arena, ptr_val); |
| 27367 | 27367 | return result; |
| ... | ... | @@ -28301,7 +28301,7 @@ fn cmpVector( |
| 28301 | 28301 | assert(rhs_ty.zigTypeTag() == .Vector); |
| 28302 | 28302 | try sema.checkVectorizableBinaryOperands(block, src, lhs_ty, rhs_ty, lhs_src, rhs_src); |
| 28303 | 28303 | |
| 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); | |
| 28305 | 28305 | |
| 28306 | 28306 | const runtime_src: LazySrcLoc = src: { |
| 28307 | 28307 | if (try sema.resolveMaybeUndefVal(lhs)) |lhs_val| { |
| ... | ... | @@ -30419,7 +30419,7 @@ pub fn typeHasOnePossibleValue(sema: *Sema, ty: Type) CompileError!?Value { |
| 30419 | 30419 | var buf: Type.Payload.ElemType = undefined; |
| 30420 | 30420 | const child_ty = ty.optionalChild(&buf); |
| 30421 | 30421 | if (child_ty.isNoReturn()) { |
| 30422 | return Value.@"null"; | |
| 30422 | return Value.null; | |
| 30423 | 30423 | } else { |
| 30424 | 30424 | return null; |
| 30425 | 30425 | } |
| ... | ... | @@ -30539,8 +30539,8 @@ pub fn typeHasOnePossibleValue(sema: *Sema, ty: Type) CompileError!?Value { |
| 30539 | 30539 | .empty_struct, .empty_struct_literal => return Value.initTag(.empty_struct_value), |
| 30540 | 30540 | .void => return Value.void, |
| 30541 | 30541 | .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), | |
| 30544 | 30544 | |
| 30545 | 30545 | .int_unsigned, .int_signed => { |
| 30546 | 30546 | if (ty.cast(Type.Payload.Bits).?.data == 0) { |
| ... | ... | @@ -30712,8 +30712,8 @@ pub fn addType(sema: *Sema, ty: Type) !Air.Inst.Ref { |
| 30712 | 30712 | .comptime_float => return .comptime_float_type, |
| 30713 | 30713 | .noreturn => return .noreturn_type, |
| 30714 | 30714 | .@"anyframe" => return .anyframe_type, |
| 30715 | .@"null" => return .null_type, | |
| 30716 | .@"undefined" => return .undefined_type, | |
| 30715 | .null => return .null_type, | |
| 30716 | .undefined => return .undefined_type, | |
| 30717 | 30717 | .enum_literal => return .enum_literal_type, |
| 30718 | 30718 | .atomic_order => return .atomic_order_type, |
| 30719 | 30719 | .atomic_rmw_op => return .atomic_rmw_op_type, |
| ... | ... | @@ -31102,8 +31102,8 @@ pub fn typeRequiresComptime(sema: *Sema, ty: Type) CompileError!bool { |
| 31102 | 31102 | .anyerror, |
| 31103 | 31103 | .noreturn, |
| 31104 | 31104 | .@"anyframe", |
| 31105 | .@"null", | |
| 31106 | .@"undefined", | |
| 31105 | .null, | |
| 31106 | .undefined, | |
| 31107 | 31107 | .atomic_order, |
| 31108 | 31108 | .atomic_rmw_op, |
| 31109 | 31109 | .calling_convention, |
src/Zir.zig+2-2| ... | ... | @@ -2367,7 +2367,7 @@ pub const Inst = struct { |
| 2367 | 2367 | }, |
| 2368 | 2368 | |
| 2369 | 2369 | .undef = .{ |
| 2370 | .ty = Type.initTag(.@"undefined"), | |
| 2370 | .ty = Type.initTag(.undefined), | |
| 2371 | 2371 | .val = Value.initTag(.undef), |
| 2372 | 2372 | }, |
| 2373 | 2373 | .zero = .{ |
| ... | ... | @@ -2395,7 +2395,7 @@ pub const Inst = struct { |
| 2395 | 2395 | .val = Value.initTag(.unreachable_value), |
| 2396 | 2396 | }, |
| 2397 | 2397 | .null_value = .{ |
| 2398 | .ty = Type.initTag(.@"null"), | |
| 2398 | .ty = Type.initTag(.null), | |
| 2399 | 2399 | .val = Value.initTag(.null_value), |
| 2400 | 2400 | }, |
| 2401 | 2401 | .bool_true = .{ |
src/arch/aarch64/CodeGen.zig+12-12| ... | ... | @@ -150,7 +150,7 @@ const MCValue = union(enum) { |
| 150 | 150 | /// * got - the value is referenced indirectly via GOT entry index (the linker emits a got-type reloc) |
| 151 | 151 | /// * direct - the value is referenced directly via symbol index index (the linker emits a displacement reloc) |
| 152 | 152 | /// * 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 }, | |
| 154 | 154 | /// The value is one of the stack variables. |
| 155 | 155 | /// |
| 156 | 156 | /// 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 |
| 4024 | 4024 | }, |
| 4025 | 4025 | .memory => |addr| try self.genSetReg(Type.usize, src_reg, .{ .immediate = @intCast(u32, addr) }), |
| 4026 | 4026 | .linker_load => |load_struct| { |
| 4027 | const tag: Mir.Inst.Tag = switch (load_struct.@"type") { | |
| 4027 | const tag: Mir.Inst.Tag = switch (load_struct.type) { | |
| 4028 | 4028 | .got => .load_memory_ptr_got, |
| 4029 | 4029 | .direct => .load_memory_ptr_direct, |
| 4030 | 4030 | .import => unreachable, |
| ... | ... | @@ -4347,7 +4347,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallOptions. |
| 4347 | 4347 | const fn_owner_decl = mod.declPtr(func.owner_decl); |
| 4348 | 4348 | try self.genSetReg(Type.initTag(.u64), .x30, .{ |
| 4349 | 4349 | .linker_load = .{ |
| 4350 | .@"type" = .got, | |
| 4350 | .type = .got, | |
| 4351 | 4351 | .sym_index = fn_owner_decl.link.macho.sym_index, |
| 4352 | 4352 | }, |
| 4353 | 4353 | }); |
| ... | ... | @@ -4385,7 +4385,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallOptions. |
| 4385 | 4385 | const fn_owner_decl = mod.declPtr(func.owner_decl); |
| 4386 | 4386 | try self.genSetReg(Type.initTag(.u64), .x30, .{ |
| 4387 | 4387 | .linker_load = .{ |
| 4388 | .@"type" = .got, | |
| 4388 | .type = .got, | |
| 4389 | 4389 | .sym_index = fn_owner_decl.link.coff.sym_index, |
| 4390 | 4390 | }, |
| 4391 | 4391 | }); |
| ... | ... | @@ -4406,7 +4406,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallOptions. |
| 4406 | 4406 | const sym_index = try coff_file.getGlobalSymbol(mem.sliceTo(decl_name, 0)); |
| 4407 | 4407 | try self.genSetReg(Type.initTag(.u64), .x30, .{ |
| 4408 | 4408 | .linker_load = .{ |
| 4409 | .@"type" = .import, | |
| 4409 | .type = .import, | |
| 4410 | 4410 | .sym_index = sym_index, |
| 4411 | 4411 | }, |
| 4412 | 4412 | }); |
| ... | ... | @@ -5534,7 +5534,7 @@ fn genSetStack(self: *Self, ty: Type, stack_offset: u32, mcv: MCValue) InnerErro |
| 5534 | 5534 | }, |
| 5535 | 5535 | .memory => |addr| try self.genSetReg(Type.usize, src_reg, .{ .immediate = addr }), |
| 5536 | 5536 | .linker_load => |load_struct| { |
| 5537 | const tag: Mir.Inst.Tag = switch (load_struct.@"type") { | |
| 5537 | const tag: Mir.Inst.Tag = switch (load_struct.type) { | |
| 5538 | 5538 | .got => .load_memory_ptr_got, |
| 5539 | 5539 | .direct => .load_memory_ptr_direct, |
| 5540 | 5540 | .import => unreachable, |
| ... | ... | @@ -5648,7 +5648,7 @@ fn genSetReg(self: *Self, ty: Type, reg: Register, mcv: MCValue) InnerError!void |
| 5648 | 5648 | }, |
| 5649 | 5649 | .register_with_overflow => unreachable, // doesn't fit into a register |
| 5650 | 5650 | .linker_load => |load_struct| { |
| 5651 | const tag: Mir.Inst.Tag = switch (load_struct.@"type") { | |
| 5651 | const tag: Mir.Inst.Tag = switch (load_struct.type) { | |
| 5652 | 5652 | .got => .load_memory_got, |
| 5653 | 5653 | .direct => .load_memory_direct, |
| 5654 | 5654 | .import => .load_memory_import, |
| ... | ... | @@ -5842,7 +5842,7 @@ fn genSetStackArgument(self: *Self, ty: Type, stack_offset: u32, mcv: MCValue) I |
| 5842 | 5842 | }, |
| 5843 | 5843 | .memory => |addr| try self.genSetReg(ptr_ty, src_reg, .{ .immediate = @intCast(u32, addr) }), |
| 5844 | 5844 | .linker_load => |load_struct| { |
| 5845 | const tag: Mir.Inst.Tag = switch (load_struct.@"type") { | |
| 5845 | const tag: Mir.Inst.Tag = switch (load_struct.type) { | |
| 5846 | 5846 | .got => .load_memory_ptr_got, |
| 5847 | 5847 | .direct => .load_memory_ptr_direct, |
| 5848 | 5848 | .import => unreachable, |
| ... | ... | @@ -6168,7 +6168,7 @@ fn lowerDeclRef(self: *Self, tv: TypedValue, decl_index: Module.Decl.Index) Inne |
| 6168 | 6168 | // the linker has enough info to perform relocations. |
| 6169 | 6169 | assert(decl.link.macho.sym_index != 0); |
| 6170 | 6170 | return MCValue{ .linker_load = .{ |
| 6171 | .@"type" = .got, | |
| 6171 | .type = .got, | |
| 6172 | 6172 | .sym_index = decl.link.macho.sym_index, |
| 6173 | 6173 | } }; |
| 6174 | 6174 | } 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 |
| 6176 | 6176 | // the linker has enough info to perform relocations. |
| 6177 | 6177 | assert(decl.link.coff.sym_index != 0); |
| 6178 | 6178 | return MCValue{ .linker_load = .{ |
| 6179 | .@"type" = .got, | |
| 6179 | .type = .got, | |
| 6180 | 6180 | .sym_index = decl.link.coff.sym_index, |
| 6181 | 6181 | } }; |
| 6182 | 6182 | } else if (self.bin_file.cast(link.File.Plan9)) |p9| { |
| ... | ... | @@ -6198,12 +6198,12 @@ fn lowerUnnamedConst(self: *Self, tv: TypedValue) InnerError!MCValue { |
| 6198 | 6198 | return MCValue{ .memory = vaddr }; |
| 6199 | 6199 | } else if (self.bin_file.cast(link.File.MachO)) |_| { |
| 6200 | 6200 | return MCValue{ .linker_load = .{ |
| 6201 | .@"type" = .direct, | |
| 6201 | .type = .direct, | |
| 6202 | 6202 | .sym_index = local_sym_index, |
| 6203 | 6203 | } }; |
| 6204 | 6204 | } else if (self.bin_file.cast(link.File.Coff)) |_| { |
| 6205 | 6205 | return MCValue{ .linker_load = .{ |
| 6206 | .@"type" = .direct, | |
| 6206 | .type = .direct, | |
| 6207 | 6207 | .sym_index = local_sym_index, |
| 6208 | 6208 | } }; |
| 6209 | 6209 | } 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 { |
| 687 | 687 | const atom = macho_file.getAtomForSymbol(.{ .sym_index = relocation.atom_index, .file = null }).?; |
| 688 | 688 | const target = macho_file.getGlobalByIndex(relocation.sym_index); |
| 689 | 689 | 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), | |
| 691 | 691 | .target = target, |
| 692 | 692 | .offset = offset, |
| 693 | 693 | .addend = 0, |
| ... | ... | @@ -906,7 +906,7 @@ fn mirLoadMemoryPie(emit: *Emit, inst: Mir.Inst.Index) !void { |
| 906 | 906 | .addend = 0, |
| 907 | 907 | .pcrel = true, |
| 908 | 908 | .length = 2, |
| 909 | .@"type" = switch (tag) { | |
| 909 | .type = switch (tag) { | |
| 910 | 910 | .load_memory_got, |
| 911 | 911 | .load_memory_ptr_got, |
| 912 | 912 | => @enumToInt(std.macho.reloc_type_arm64.ARM64_RELOC_GOT_LOAD_PAGE21), |
| ... | ... | @@ -922,7 +922,7 @@ fn mirLoadMemoryPie(emit: *Emit, inst: Mir.Inst.Index) !void { |
| 922 | 922 | .addend = 0, |
| 923 | 923 | .pcrel = false, |
| 924 | 924 | .length = 2, |
| 925 | .@"type" = switch (tag) { | |
| 925 | .type = switch (tag) { | |
| 926 | 926 | .load_memory_got, |
| 927 | 927 | .load_memory_ptr_got, |
| 928 | 928 | => @enumToInt(std.macho.reloc_type_arm64.ARM64_RELOC_GOT_LOAD_PAGEOFF12), |
| ... | ... | @@ -949,7 +949,7 @@ fn mirLoadMemoryPie(emit: *Emit, inst: Mir.Inst.Index) !void { |
| 949 | 949 | .addend = 0, |
| 950 | 950 | .pcrel = true, |
| 951 | 951 | .length = 2, |
| 952 | .@"type" = switch (tag) { | |
| 952 | .type = switch (tag) { | |
| 953 | 953 | .load_memory_got, |
| 954 | 954 | .load_memory_ptr_got, |
| 955 | 955 | => .got_page, |
| ... | ... | @@ -966,7 +966,7 @@ fn mirLoadMemoryPie(emit: *Emit, inst: Mir.Inst.Index) !void { |
| 966 | 966 | .addend = 0, |
| 967 | 967 | .pcrel = false, |
| 968 | 968 | .length = 2, |
| 969 | .@"type" = switch (tag) { | |
| 969 | .type = switch (tag) { | |
| 970 | 970 | .load_memory_got, |
| 971 | 971 | .load_memory_ptr_got, |
| 972 | 972 | => .got_pageoff, |
src/arch/sparc64/CodeGen.zig+1-1| ... | ... | @@ -446,7 +446,7 @@ fn gen(self: *Self) !void { |
| 446 | 446 | .data = .{ |
| 447 | 447 | .arithmetic_2op = .{ |
| 448 | 448 | .is_imm = true, |
| 449 | .rs1 = .@"i7", | |
| 449 | .rs1 = .i7, | |
| 450 | 450 | .rs2_or_imm = .{ .imm = 8 }, |
| 451 | 451 | }, |
| 452 | 452 | }, |
src/arch/sparc64/bits.zig+10-10| ... | ... | @@ -35,14 +35,14 @@ test "Register.id" { |
| 35 | 35 | try testing.expectEqual(Register.o6.id(), Register.sp.id()); |
| 36 | 36 | |
| 37 | 37 | // 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()); | |
| 40 | 40 | |
| 41 | 41 | // x0 |
| 42 | 42 | try testing.expectEqual(@as(u5, 0), Register.g0.id()); |
| 43 | 43 | try testing.expectEqual(@as(u5, 8), Register.o0.id()); |
| 44 | 44 | 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()); | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | test "Register.enc" { |
| ... | ... | @@ -50,13 +50,13 @@ test "Register.enc" { |
| 50 | 50 | try testing.expectEqual(@as(u5, 0), Register.g0.enc()); |
| 51 | 51 | try testing.expectEqual(@as(u5, 8), Register.o0.enc()); |
| 52 | 52 | 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()); | |
| 54 | 54 | |
| 55 | 55 | // For integer registers, enc() == id(). |
| 56 | 56 | try testing.expectEqual(Register.g0.enc(), Register.g0.id()); |
| 57 | 57 | try testing.expectEqual(Register.o0.enc(), Register.o0.id()); |
| 58 | 58 | 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()); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /// Scalar floating point registers in the SPARCv9 instruction set |
| ... | ... | @@ -127,11 +127,11 @@ test "FloatingPointRegister.id" { |
| 127 | 127 | // Low region |
| 128 | 128 | try testing.expectEqual(@as(u6, 0), FloatingPointRegister.q0.id()); |
| 129 | 129 | 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()); | |
| 131 | 131 | |
| 132 | 132 | try testing.expectEqual(@as(u6, 28), FloatingPointRegister.q28.id()); |
| 133 | 133 | 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()); | |
| 135 | 135 | |
| 136 | 136 | // High region |
| 137 | 137 | try testing.expectEqual(@as(u6, 32), FloatingPointRegister.q32.id()); |
| ... | ... | @@ -143,9 +143,9 @@ test "FloatingPointRegister.id" { |
| 143 | 143 | |
| 144 | 144 | test "FloatingPointRegister.enc" { |
| 145 | 145 | // 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()); | |
| 149 | 149 | |
| 150 | 150 | // d registers |
| 151 | 151 | 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) { |
| 132 | 132 | /// * got - the value is referenced indirectly via GOT entry index (the linker emits a got-type reloc) |
| 133 | 133 | /// * direct - the value is referenced directly via symbol index index (the linker emits a displacement reloc) |
| 134 | 134 | /// * 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 }, | |
| 136 | 136 | /// The value is one of the stack variables. |
| 137 | 137 | /// If the type is a pointer, it means the pointer address is in the stack at this offset. |
| 138 | 138 | stack_offset: i32, |
| ... | ... | @@ -2671,7 +2671,7 @@ fn loadMemPtrIntoRegister(self: *Self, reg: Register, ptr_ty: Type, ptr: MCValue |
| 2671 | 2671 | fn_owner_decl.link.macho.sym_index |
| 2672 | 2672 | else |
| 2673 | 2673 | fn_owner_decl.link.coff.sym_index; |
| 2674 | const flags: u2 = switch (load_struct.@"type") { | |
| 2674 | const flags: u2 = switch (load_struct.type) { | |
| 2675 | 2675 | .got => 0b00, |
| 2676 | 2676 | .direct => 0b01, |
| 2677 | 2677 | .import => 0b10, |
| ... | ... | @@ -4010,7 +4010,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallOptions. |
| 4010 | 4010 | const fn_owner_decl = mod.declPtr(func.owner_decl); |
| 4011 | 4011 | try self.genSetReg(Type.initTag(.usize), .rax, .{ |
| 4012 | 4012 | .linker_load = .{ |
| 4013 | .@"type" = .got, | |
| 4013 | .type = .got, | |
| 4014 | 4014 | .sym_index = fn_owner_decl.link.coff.sym_index, |
| 4015 | 4015 | }, |
| 4016 | 4016 | }); |
| ... | ... | @@ -4034,7 +4034,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallOptions. |
| 4034 | 4034 | const sym_index = try coff_file.getGlobalSymbol(mem.sliceTo(decl_name, 0)); |
| 4035 | 4035 | try self.genSetReg(Type.initTag(.usize), .rax, .{ |
| 4036 | 4036 | .linker_load = .{ |
| 4037 | .@"type" = .import, | |
| 4037 | .type = .import, | |
| 4038 | 4038 | .sym_index = sym_index, |
| 4039 | 4039 | }, |
| 4040 | 4040 | }); |
| ... | ... | @@ -4070,7 +4070,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallOptions. |
| 4070 | 4070 | const sym_index = fn_owner_decl.link.macho.sym_index; |
| 4071 | 4071 | try self.genSetReg(Type.initTag(.usize), .rax, .{ |
| 4072 | 4072 | .linker_load = .{ |
| 4073 | .@"type" = .got, | |
| 4073 | .type = .got, | |
| 4074 | 4074 | .sym_index = sym_index, |
| 4075 | 4075 | }, |
| 4076 | 4076 | }); |
| ... | ... | @@ -6925,13 +6925,13 @@ fn lowerDeclRef(self: *Self, tv: TypedValue, decl_index: Module.Decl.Index) Inne |
| 6925 | 6925 | } else if (self.bin_file.cast(link.File.MachO)) |_| { |
| 6926 | 6926 | assert(decl.link.macho.sym_index != 0); |
| 6927 | 6927 | return MCValue{ .linker_load = .{ |
| 6928 | .@"type" = .got, | |
| 6928 | .type = .got, | |
| 6929 | 6929 | .sym_index = decl.link.macho.sym_index, |
| 6930 | 6930 | } }; |
| 6931 | 6931 | } else if (self.bin_file.cast(link.File.Coff)) |_| { |
| 6932 | 6932 | assert(decl.link.coff.sym_index != 0); |
| 6933 | 6933 | return MCValue{ .linker_load = .{ |
| 6934 | .@"type" = .got, | |
| 6934 | .type = .got, | |
| 6935 | 6935 | .sym_index = decl.link.coff.sym_index, |
| 6936 | 6936 | } }; |
| 6937 | 6937 | } else if (self.bin_file.cast(link.File.Plan9)) |p9| { |
| ... | ... | @@ -6953,12 +6953,12 @@ fn lowerUnnamedConst(self: *Self, tv: TypedValue) InnerError!MCValue { |
| 6953 | 6953 | return MCValue{ .memory = vaddr }; |
| 6954 | 6954 | } else if (self.bin_file.cast(link.File.MachO)) |_| { |
| 6955 | 6955 | return MCValue{ .linker_load = .{ |
| 6956 | .@"type" = .direct, | |
| 6956 | .type = .direct, | |
| 6957 | 6957 | .sym_index = local_sym_index, |
| 6958 | 6958 | } }; |
| 6959 | 6959 | } else if (self.bin_file.cast(link.File.Coff)) |_| { |
| 6960 | 6960 | return MCValue{ .linker_load = .{ |
| 6961 | .@"type" = .direct, | |
| 6961 | .type = .direct, | |
| 6962 | 6962 | .sym_index = local_sym_index, |
| 6963 | 6963 | } }; |
| 6964 | 6964 | } 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 { |
| 1005 | 1005 | }; |
| 1006 | 1006 | const atom = macho_file.getAtomForSymbol(.{ .sym_index = relocation.atom_index, .file = null }).?; |
| 1007 | 1007 | try atom.addRelocation(macho_file, .{ |
| 1008 | .@"type" = reloc_type, | |
| 1008 | .type = reloc_type, | |
| 1009 | 1009 | .target = .{ .sym_index = relocation.sym_index, .file = null }, |
| 1010 | 1010 | .offset = @intCast(u32, end_offset - 4), |
| 1011 | 1011 | .addend = 0, |
| ... | ... | @@ -1015,7 +1015,7 @@ fn mirLeaPic(emit: *Emit, inst: Mir.Inst.Index) InnerError!void { |
| 1015 | 1015 | } else if (emit.bin_file.cast(link.File.Coff)) |coff_file| { |
| 1016 | 1016 | const atom = coff_file.getAtomForSymbol(.{ .sym_index = relocation.atom_index, .file = null }).?; |
| 1017 | 1017 | try atom.addRelocation(coff_file, .{ |
| 1018 | .@"type" = switch (ops.flags) { | |
| 1018 | .type = switch (ops.flags) { | |
| 1019 | 1019 | 0b00 => .got, |
| 1020 | 1020 | 0b01 => .direct, |
| 1021 | 1021 | 0b10 => .import, |
| ... | ... | @@ -1145,7 +1145,7 @@ fn mirCallExtern(emit: *Emit, inst: Mir.Inst.Index) InnerError!void { |
| 1145 | 1145 | const atom = macho_file.getAtomForSymbol(.{ .sym_index = relocation.atom_index, .file = null }).?; |
| 1146 | 1146 | const target = macho_file.getGlobalByIndex(relocation.sym_index); |
| 1147 | 1147 | 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), | |
| 1149 | 1149 | .target = target, |
| 1150 | 1150 | .offset = offset, |
| 1151 | 1151 | .addend = 0, |
| ... | ... | @@ -1157,7 +1157,7 @@ fn mirCallExtern(emit: *Emit, inst: Mir.Inst.Index) InnerError!void { |
| 1157 | 1157 | const atom = coff_file.getAtomForSymbol(.{ .sym_index = relocation.atom_index, .file = null }).?; |
| 1158 | 1158 | const target = coff_file.getGlobalByIndex(relocation.sym_index); |
| 1159 | 1159 | try atom.addRelocation(coff_file, .{ |
| 1160 | .@"type" = .direct, | |
| 1160 | .type = .direct, | |
| 1161 | 1161 | .target = target, |
| 1162 | 1162 | .offset = offset, |
| 1163 | 1163 | .addend = 0, |
src/codegen/c.zig+10-10| ... | ... | @@ -607,7 +607,7 @@ pub const DeclGen = struct { |
| 607 | 607 | if (val.isUndefDeep()) { |
| 608 | 608 | switch (ty.zigTypeTag()) { |
| 609 | 609 | // 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), | |
| 611 | 611 | .Int, .Enum, .ErrorSet => return writer.print("{x}", .{try dg.fmtIntLiteral(ty, val)}), |
| 612 | 612 | .Float => { |
| 613 | 613 | const bits = ty.floatBits(target); |
| ... | ... | @@ -1964,7 +1964,7 @@ pub const DeclGen = struct { |
| 1964 | 1964 | try buffer.appendSlice(" }\n"); |
| 1965 | 1965 | } |
| 1966 | 1966 | 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); | |
| 1968 | 1968 | try buffer.appendSlice(") "); |
| 1969 | 1969 | _ = try airBreakpoint(bw); |
| 1970 | 1970 | try buffer.appendSlice("}\n"); |
| ... | ... | @@ -3800,7 +3800,7 @@ fn airLoop(f: *Function, inst: Air.Inst.Index) !CValue { |
| 3800 | 3800 | const body = f.air.extra[loop.end..][0..loop.data.body_len]; |
| 3801 | 3801 | const writer = f.object.writer(); |
| 3802 | 3802 | 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); | |
| 3804 | 3804 | try writer.writeAll(") "); |
| 3805 | 3805 | try genBody(f, body); |
| 3806 | 3806 | try writer.writeByte('\n'); |
| ... | ... | @@ -4095,19 +4095,19 @@ fn airIsNull( |
| 4095 | 4095 | var slice_ptr_buf: Type.SlicePtrFieldTypeBuffer = undefined; |
| 4096 | 4096 | |
| 4097 | 4097 | const rhs = if (!payload_ty.hasRuntimeBitsIgnoreComptime()) |
| 4098 | TypedValue{ .ty = Type.bool, .val = Value.@"true" } | |
| 4098 | TypedValue{ .ty = Type.bool, .val = Value.true } | |
| 4099 | 4099 | else if (optional_ty.isPtrLikeOptional()) |
| 4100 | 4100 | // operand is a regular pointer, test `operand !=/== NULL` |
| 4101 | TypedValue{ .ty = optional_ty, .val = Value.@"null" } | |
| 4101 | TypedValue{ .ty = optional_ty, .val = Value.null } | |
| 4102 | 4102 | else if (payload_ty.zigTypeTag() == .ErrorSet) |
| 4103 | 4103 | TypedValue{ .ty = payload_ty, .val = Value.zero } |
| 4104 | 4104 | else if (payload_ty.isSlice() and optional_ty.optionalReprIsPayload()) rhs: { |
| 4105 | 4105 | try writer.writeAll(".ptr"); |
| 4106 | 4106 | 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 }; | |
| 4108 | 4108 | } else rhs: { |
| 4109 | 4109 | 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 }; | |
| 4111 | 4111 | }; |
| 4112 | 4112 | try writer.writeByte(' '); |
| 4113 | 4113 | try writer.writeAll(operator); |
| ... | ... | @@ -4195,7 +4195,7 @@ fn airOptionalPayloadPtrSet(f: *Function, inst: Air.Inst.Index) !CValue { |
| 4195 | 4195 | |
| 4196 | 4196 | try f.writeCValueDeref(writer, operand); |
| 4197 | 4197 | 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); | |
| 4199 | 4199 | try writer.writeAll(";\n"); |
| 4200 | 4200 | |
| 4201 | 4201 | const inst_ty = f.air.typeOfIndex(inst); |
| ... | ... | @@ -4534,7 +4534,7 @@ fn airWrapOptional(f: *Function, inst: Air.Inst.Index) !CValue { |
| 4534 | 4534 | try writer.writeAll(" = { .payload = "); |
| 4535 | 4535 | try f.writeCValue(writer, if (is_array) CValue{ .undef = payload_ty } else payload, .Initializer); |
| 4536 | 4536 | 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); | |
| 4538 | 4538 | try writer.writeAll(" };\n"); |
| 4539 | 4539 | if (is_array) { |
| 4540 | 4540 | try writer.writeAll("memcpy("); |
| ... | ... | @@ -4862,7 +4862,7 @@ fn airCmpxchg(f: *Function, inst: Air.Inst.Index, flavor: [*:0]const u8) !CValue |
| 4862 | 4862 | try f.writeCValue(writer, expected_value, .Initializer); |
| 4863 | 4863 | if (is_struct) { |
| 4864 | 4864 | 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); | |
| 4866 | 4866 | try writer.writeAll(" }"); |
| 4867 | 4867 | } |
| 4868 | 4868 | try writer.writeAll(";\n"); |
src/codegen/llvm.zig+1-1| ... | ... | @@ -10723,7 +10723,7 @@ fn ccAbiPromoteInt( |
| 10723 | 10723 | else => {}, |
| 10724 | 10724 | } |
| 10725 | 10725 | const int_info = switch (ty.zigTypeTag()) { |
| 10726 | .Bool => Type.@"u1".intInfo(target), | |
| 10726 | .Bool => Type.u1.intInfo(target), | |
| 10727 | 10727 | .Int, .Enum, .ErrorSet => ty.intInfo(target), |
| 10728 | 10728 | else => return null, |
| 10729 | 10729 | }; |
src/codegen/spirv/type.zig+1-1| ... | ... | @@ -104,7 +104,7 @@ pub const Type = extern union { |
| 104 | 104 | } |
| 105 | 105 | return true; |
| 106 | 106 | }, |
| 107 | .@"function" => { | |
| 107 | .function => { | |
| 108 | 108 | const fn_a = a.payload(.function); |
| 109 | 109 | const fn_b = b.payload(.function); |
| 110 | 110 | if (fn_a.return_type != fn_b.return_type) |
src/link/Coff.zig+10-10| ... | ... | @@ -337,7 +337,7 @@ fn populateMissingMetadata(self: *Coff) !void { |
| 337 | 337 | .name = [_]u8{0} ** 8, |
| 338 | 338 | .value = 0, |
| 339 | 339 | .section_number = .UNDEFINED, |
| 340 | .@"type" = .{ .base_type = .NULL, .complex_type = .NULL }, | |
| 340 | .type = .{ .base_type = .NULL, .complex_type = .NULL }, | |
| 341 | 341 | .storage_class = .NULL, |
| 342 | 342 | .number_of_aux_symbols = 0, |
| 343 | 343 | }); |
| ... | ... | @@ -635,7 +635,7 @@ fn allocateSymbol(self: *Coff) !u32 { |
| 635 | 635 | .name = [_]u8{0} ** 8, |
| 636 | 636 | .value = 0, |
| 637 | 637 | .section_number = .UNDEFINED, |
| 638 | .@"type" = .{ .base_type = .NULL, .complex_type = .NULL }, | |
| 638 | .type = .{ .base_type = .NULL, .complex_type = .NULL }, | |
| 639 | 639 | .storage_class = .NULL, |
| 640 | 640 | .number_of_aux_symbols = 0, |
| 641 | 641 | }; |
| ... | ... | @@ -730,7 +730,7 @@ fn createGotAtom(self: *Coff, target: SymbolWithLoc) !*Atom { |
| 730 | 730 | log.debug("allocated GOT atom at 0x{x}", .{sym.value}); |
| 731 | 731 | |
| 732 | 732 | try atom.addRelocation(self, .{ |
| 733 | .@"type" = .direct, | |
| 733 | .type = .direct, | |
| 734 | 734 | .target = target, |
| 735 | 735 | .offset = 0, |
| 736 | 736 | .addend = 0, |
| ... | ... | @@ -1106,7 +1106,7 @@ fn updateDeclCode(self: *Coff, decl_index: Module.Decl.Index, code: []const u8, |
| 1106 | 1106 | const sym = atom.getSymbolPtr(self); |
| 1107 | 1107 | try self.setSymbolName(sym, decl_name); |
| 1108 | 1108 | 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 }; | |
| 1110 | 1110 | |
| 1111 | 1111 | const capacity = atom.capacity(self); |
| 1112 | 1112 | 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, |
| 1131 | 1131 | const sym = atom.getSymbolPtr(self); |
| 1132 | 1132 | try self.setSymbolName(sym, decl_name); |
| 1133 | 1133 | 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 }; | |
| 1135 | 1135 | |
| 1136 | 1136 | const vaddr = try self.allocateAtom(atom, code_len, required_alignment); |
| 1137 | 1137 | errdefer self.freeAtom(atom); |
| ... | ... | @@ -1307,7 +1307,7 @@ pub fn updateDeclExports( |
| 1307 | 1307 | try self.setSymbolName(sym, exp.options.name); |
| 1308 | 1308 | sym.value = decl_sym.value; |
| 1309 | 1309 | 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 }; | |
| 1311 | 1311 | |
| 1312 | 1312 | switch (exp.options.linkage) { |
| 1313 | 1313 | .Strong => { |
| ... | ... | @@ -1337,7 +1337,7 @@ pub fn deleteExport(self: *Coff, exp: Export) void { |
| 1337 | 1337 | .name = [_]u8{0} ** 8, |
| 1338 | 1338 | .value = 0, |
| 1339 | 1339 | .section_number = .UNDEFINED, |
| 1340 | .@"type" = .{ .base_type = .NULL, .complex_type = .NULL }, | |
| 1340 | .type = .{ .base_type = .NULL, .complex_type = .NULL }, | |
| 1341 | 1341 | .storage_class = .NULL, |
| 1342 | 1342 | .number_of_aux_symbols = 0, |
| 1343 | 1343 | }; |
| ... | ... | @@ -1465,7 +1465,7 @@ pub fn getDeclVAddr( |
| 1465 | 1465 | const atom = self.getAtomForSymbol(.{ .sym_index = reloc_info.parent_atom_index, .file = null }).?; |
| 1466 | 1466 | const target = SymbolWithLoc{ .sym_index = decl.link.coff.sym_index, .file = null }; |
| 1467 | 1467 | try atom.addRelocation(self, .{ |
| 1468 | .@"type" = .direct, | |
| 1468 | .type = .direct, | |
| 1469 | 1469 | .target = target, |
| 1470 | 1470 | .offset = @intCast(u32, reloc_info.offset), |
| 1471 | 1471 | .addend = reloc_info.addend, |
| ... | ... | @@ -1537,7 +1537,7 @@ fn writeBaseRelocations(self: *Coff) !void { |
| 1537 | 1537 | } |
| 1538 | 1538 | try gop.value_ptr.append(.{ |
| 1539 | 1539 | .offset = @intCast(u12, rva - page), |
| 1540 | .@"type" = .DIR64, | |
| 1540 | .type = .DIR64, | |
| 1541 | 1541 | }); |
| 1542 | 1542 | } |
| 1543 | 1543 | } |
| ... | ... | @@ -1555,7 +1555,7 @@ fn writeBaseRelocations(self: *Coff) !void { |
| 1555 | 1555 | )) { |
| 1556 | 1556 | try entry.value_ptr.append(.{ |
| 1557 | 1557 | .offset = 0, |
| 1558 | .@"type" = .ABSOLUTE, | |
| 1558 | .type = .ABSOLUTE, | |
| 1559 | 1559 | }); |
| 1560 | 1560 | } |
| 1561 | 1561 |
src/link/Coff/Atom.zig+1-1| ... | ... | @@ -94,7 +94,7 @@ pub fn freeListEligible(self: Atom, coff_file: *const Coff) bool { |
| 94 | 94 | |
| 95 | 95 | pub fn addRelocation(self: *Atom, coff_file: *Coff, reloc: Relocation) !void { |
| 96 | 96 | 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 }); | |
| 98 | 98 | const gop = try coff_file.relocs.getOrPut(gpa, self); |
| 99 | 99 | if (!gop.found_existing) { |
| 100 | 100 | gop.value_ptr.* = .{}; |
src/link/Coff/Relocation.zig+5-5| ... | ... | @@ -13,7 +13,7 @@ const Atom = @import("Atom.zig"); |
| 13 | 13 | const Coff = @import("../Coff.zig"); |
| 14 | 14 | const SymbolWithLoc = Coff.SymbolWithLoc; |
| 15 | 15 | |
| 16 | @"type": enum { | |
| 16 | type: enum { | |
| 17 | 17 | // x86, x86_64 |
| 18 | 18 | /// RIP-relative displacement to a GOT pointer |
| 19 | 19 | got, |
| ... | ... | @@ -47,7 +47,7 @@ dirty: bool = true, |
| 47 | 47 | |
| 48 | 48 | /// Returns an Atom which is the target node of this relocation edge (if any). |
| 49 | 49 | pub fn getTargetAtom(self: Relocation, coff_file: *Coff) ?*Atom { |
| 50 | switch (self.@"type") { | |
| 50 | switch (self.type) { | |
| 51 | 51 | .got, |
| 52 | 52 | .got_page, |
| 53 | 53 | .got_pageoff, |
| ... | ... | @@ -80,7 +80,7 @@ pub fn resolve(self: *Relocation, atom: *Atom, coff_file: *Coff) !void { |
| 80 | 80 | source_vaddr, |
| 81 | 81 | target_vaddr_with_addend, |
| 82 | 82 | coff_file.getSymbolName(self.target), |
| 83 | @tagName(self.@"type"), | |
| 83 | @tagName(self.type), | |
| 84 | 84 | file_offset + self.offset, |
| 85 | 85 | }); |
| 86 | 86 | |
| ... | ... | @@ -121,7 +121,7 @@ fn resolveAarch64(self: *Relocation, ctx: Context, coff_file: *Coff) !void { |
| 121 | 121 | else => unreachable, |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | switch (self.@"type") { | |
| 124 | switch (self.type) { | |
| 125 | 125 | .got_page, .import_page, .page => { |
| 126 | 126 | const source_page = @intCast(i32, ctx.source_vaddr >> 12); |
| 127 | 127 | const target_page = @intCast(i32, ctx.target_vaddr >> 12); |
| ... | ... | @@ -198,7 +198,7 @@ fn resolveAarch64(self: *Relocation, ctx: Context, coff_file: *Coff) !void { |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | fn resolveX86(self: *Relocation, ctx: Context, coff_file: *Coff) !void { |
| 201 | switch (self.@"type") { | |
| 201 | switch (self.type) { | |
| 202 | 202 | .got_page => unreachable, |
| 203 | 203 | .got_pageoff => unreachable, |
| 204 | 204 | .page => unreachable, |
src/link/Dwarf.zig+7-7| ... | ... | @@ -104,7 +104,7 @@ pub const DeclState = struct { |
| 104 | 104 | pub fn addExprlocReloc(self: *DeclState, target: u32, offset: u32, is_ptr: bool) !void { |
| 105 | 105 | log.debug("{x}: target sym %{d}, via GOT {}", .{ offset, target, is_ptr }); |
| 106 | 106 | 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, | |
| 108 | 108 | .target = target, |
| 109 | 109 | .offset = offset, |
| 110 | 110 | }); |
| ... | ... | @@ -132,7 +132,7 @@ pub const DeclState = struct { |
| 132 | 132 | const sym_index = @intCast(u32, self.abbrev_table.items.len); |
| 133 | 133 | try self.abbrev_table.append(self.gpa, .{ |
| 134 | 134 | .atom = atom, |
| 135 | .@"type" = ty, | |
| 135 | .type = ty, | |
| 136 | 136 | .offset = undefined, |
| 137 | 137 | }); |
| 138 | 138 | log.debug("%{d}: {}", .{ sym_index, ty.fmtDebug() }); |
| ... | ... | @@ -564,7 +564,7 @@ pub const DeclState = struct { |
| 564 | 564 | |
| 565 | 565 | pub const AbbrevEntry = struct { |
| 566 | 566 | atom: *const Atom, |
| 567 | @"type": Type, | |
| 567 | type: Type, | |
| 568 | 568 | offset: u32, |
| 569 | 569 | }; |
| 570 | 570 | |
| ... | ... | @@ -579,7 +579,7 @@ pub const AbbrevRelocation = struct { |
| 579 | 579 | |
| 580 | 580 | pub const ExprlocRelocation = struct { |
| 581 | 581 | /// Type of the relocation: direct load ref, or GOT load ref (via GOT table) |
| 582 | @"type": enum { | |
| 582 | type: enum { | |
| 583 | 583 | direct_load, |
| 584 | 584 | got_load, |
| 585 | 585 | }, |
| ... | ... | @@ -1022,7 +1022,7 @@ pub fn commitDeclState( |
| 1022 | 1022 | var sym_index: usize = 0; |
| 1023 | 1023 | while (sym_index < decl_state.abbrev_table.items.len) : (sym_index += 1) { |
| 1024 | 1024 | const symbol = &decl_state.abbrev_table.items[sym_index]; |
| 1025 | const ty = symbol.@"type"; | |
| 1025 | const ty = symbol.type; | |
| 1026 | 1026 | const deferred: bool = blk: { |
| 1027 | 1027 | if (ty.isAnyError()) break :blk true; |
| 1028 | 1028 | switch (ty.tag()) { |
| ... | ... | @@ -1046,7 +1046,7 @@ pub fn commitDeclState( |
| 1046 | 1046 | while (decl_state.abbrev_relocs.popOrNull()) |reloc| { |
| 1047 | 1047 | if (reloc.target) |target| { |
| 1048 | 1048 | const symbol = decl_state.abbrev_table.items[target]; |
| 1049 | const ty = symbol.@"type"; | |
| 1049 | const ty = symbol.type; | |
| 1050 | 1050 | const deferred: bool = blk: { |
| 1051 | 1051 | if (ty.isAnyError()) break :blk true; |
| 1052 | 1052 | switch (ty.tag()) { |
| ... | ... | @@ -1091,7 +1091,7 @@ pub fn commitDeclState( |
| 1091 | 1091 | const macho_file = file.cast(File.MachO).?; |
| 1092 | 1092 | const d_sym = &macho_file.d_sym.?; |
| 1093 | 1093 | try d_sym.relocs.append(d_sym.base.base.allocator, .{ |
| 1094 | .@"type" = switch (reloc.@"type") { | |
| 1094 | .type = switch (reloc.type) { | |
| 1095 | 1095 | .direct_load => .direct_load, |
| 1096 | 1096 | .got_load => .got_load, |
| 1097 | 1097 | }, |
src/link/MachO.zig+17-17| ... | ... | @@ -1059,7 +1059,7 @@ pub fn createGotAtom(self: *MachO, target: SymbolWithLoc) !*Atom { |
| 1059 | 1059 | log.debug("allocated GOT atom at 0x{x}", .{sym.n_value}); |
| 1060 | 1060 | |
| 1061 | 1061 | try atom.addRelocation(self, .{ |
| 1062 | .@"type" = switch (self.base.options.target.cpu.arch) { | |
| 1062 | .type = switch (self.base.options.target.cpu.arch) { | |
| 1063 | 1063 | .aarch64 => @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_UNSIGNED), |
| 1064 | 1064 | .x86_64 => @enumToInt(macho.reloc_type_x86_64.X86_64_RELOC_UNSIGNED), |
| 1065 | 1065 | else => unreachable, |
| ... | ... | @@ -1164,14 +1164,14 @@ pub fn createStubHelperPreambleAtom(self: *MachO) !void { |
| 1164 | 1164 | code[10] = 0x25; |
| 1165 | 1165 | |
| 1166 | 1166 | 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), | |
| 1168 | 1168 | .target = .{ .sym_index = dyld_private_sym_index, .file = null }, |
| 1169 | 1169 | .offset = 3, |
| 1170 | 1170 | .addend = 0, |
| 1171 | 1171 | .pcrel = true, |
| 1172 | 1172 | .length = 2, |
| 1173 | 1173 | }, .{ |
| 1174 | .@"type" = @enumToInt(macho.reloc_type_x86_64.X86_64_RELOC_GOT), | |
| 1174 | .type = @enumToInt(macho.reloc_type_x86_64.X86_64_RELOC_GOT), | |
| 1175 | 1175 | .target = .{ .sym_index = self.dyld_stub_binder_index.?, .file = null }, |
| 1176 | 1176 | .offset = 11, |
| 1177 | 1177 | .addend = 0, |
| ... | ... | @@ -1204,28 +1204,28 @@ pub fn createStubHelperPreambleAtom(self: *MachO) !void { |
| 1204 | 1204 | mem.writeIntLittle(u32, code[20..][0..4], aarch64.Instruction.br(.x16).toU32()); |
| 1205 | 1205 | |
| 1206 | 1206 | 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), | |
| 1208 | 1208 | .target = .{ .sym_index = dyld_private_sym_index, .file = null }, |
| 1209 | 1209 | .offset = 0, |
| 1210 | 1210 | .addend = 0, |
| 1211 | 1211 | .pcrel = true, |
| 1212 | 1212 | .length = 2, |
| 1213 | 1213 | }, .{ |
| 1214 | .@"type" = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_PAGEOFF12), | |
| 1214 | .type = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_PAGEOFF12), | |
| 1215 | 1215 | .target = .{ .sym_index = dyld_private_sym_index, .file = null }, |
| 1216 | 1216 | .offset = 4, |
| 1217 | 1217 | .addend = 0, |
| 1218 | 1218 | .pcrel = false, |
| 1219 | 1219 | .length = 2, |
| 1220 | 1220 | }, .{ |
| 1221 | .@"type" = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_GOT_LOAD_PAGE21), | |
| 1221 | .type = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_GOT_LOAD_PAGE21), | |
| 1222 | 1222 | .target = .{ .sym_index = self.dyld_stub_binder_index.?, .file = null }, |
| 1223 | 1223 | .offset = 12, |
| 1224 | 1224 | .addend = 0, |
| 1225 | 1225 | .pcrel = true, |
| 1226 | 1226 | .length = 2, |
| 1227 | 1227 | }, .{ |
| 1228 | .@"type" = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_GOT_LOAD_PAGEOFF12), | |
| 1228 | .type = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_GOT_LOAD_PAGEOFF12), | |
| 1229 | 1229 | .target = .{ .sym_index = self.dyld_stub_binder_index.?, .file = null }, |
| 1230 | 1230 | .offset = 16, |
| 1231 | 1231 | .addend = 0, |
| ... | ... | @@ -1286,7 +1286,7 @@ pub fn createStubHelperAtom(self: *MachO) !*Atom { |
| 1286 | 1286 | code[5] = 0xe9; |
| 1287 | 1287 | |
| 1288 | 1288 | 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), | |
| 1290 | 1290 | .target = .{ .sym_index = self.stub_helper_preamble_atom.?.sym_index, .file = null }, |
| 1291 | 1291 | .offset = 6, |
| 1292 | 1292 | .addend = 0, |
| ... | ... | @@ -1309,7 +1309,7 @@ pub fn createStubHelperAtom(self: *MachO) !*Atom { |
| 1309 | 1309 | // Next 4 bytes 8..12 are just a placeholder populated in `populateLazyBindOffsetsInStubHelper`. |
| 1310 | 1310 | |
| 1311 | 1311 | try atom.addRelocation(self, .{ |
| 1312 | .@"type" = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_BRANCH26), | |
| 1312 | .type = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_BRANCH26), | |
| 1313 | 1313 | .target = .{ .sym_index = self.stub_helper_preamble_atom.?.sym_index, .file = null }, |
| 1314 | 1314 | .offset = 4, |
| 1315 | 1315 | .addend = 0, |
| ... | ... | @@ -1348,7 +1348,7 @@ pub fn createLazyPointerAtom(self: *MachO, stub_sym_index: u32, target: SymbolWi |
| 1348 | 1348 | sym.n_sect = self.la_symbol_ptr_section_index.? + 1; |
| 1349 | 1349 | |
| 1350 | 1350 | try atom.addRelocation(self, .{ |
| 1351 | .@"type" = switch (self.base.options.target.cpu.arch) { | |
| 1351 | .type = switch (self.base.options.target.cpu.arch) { | |
| 1352 | 1352 | .aarch64 => @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_UNSIGNED), |
| 1353 | 1353 | .x86_64 => @enumToInt(macho.reloc_type_x86_64.X86_64_RELOC_UNSIGNED), |
| 1354 | 1354 | else => unreachable, |
| ... | ... | @@ -1414,7 +1414,7 @@ pub fn createStubAtom(self: *MachO, laptr_sym_index: u32) !*Atom { |
| 1414 | 1414 | code[1] = 0x25; |
| 1415 | 1415 | |
| 1416 | 1416 | 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), | |
| 1418 | 1418 | .target = .{ .sym_index = laptr_sym_index, .file = null }, |
| 1419 | 1419 | .offset = 2, |
| 1420 | 1420 | .addend = 0, |
| ... | ... | @@ -1436,7 +1436,7 @@ pub fn createStubAtom(self: *MachO, laptr_sym_index: u32) !*Atom { |
| 1436 | 1436 | |
| 1437 | 1437 | try atom.addRelocations(self, 2, .{ |
| 1438 | 1438 | .{ |
| 1439 | .@"type" = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_PAGE21), | |
| 1439 | .type = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_PAGE21), | |
| 1440 | 1440 | .target = .{ .sym_index = laptr_sym_index, .file = null }, |
| 1441 | 1441 | .offset = 0, |
| 1442 | 1442 | .addend = 0, |
| ... | ... | @@ -1444,7 +1444,7 @@ pub fn createStubAtom(self: *MachO, laptr_sym_index: u32) !*Atom { |
| 1444 | 1444 | .length = 2, |
| 1445 | 1445 | }, |
| 1446 | 1446 | .{ |
| 1447 | .@"type" = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_PAGEOFF12), | |
| 1447 | .type = @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_PAGEOFF12), | |
| 1448 | 1448 | .target = .{ .sym_index = laptr_sym_index, .file = null }, |
| 1449 | 1449 | .offset = 4, |
| 1450 | 1450 | .addend = 0, |
| ... | ... | @@ -2446,7 +2446,7 @@ pub fn getOutputSection(self: *MachO, sect: macho.section_64) !?u8 { |
| 2446 | 2446 | break :blk null; |
| 2447 | 2447 | } |
| 2448 | 2448 | |
| 2449 | switch (sect.@"type"()) { | |
| 2449 | switch (sect.type()) { | |
| 2450 | 2450 | macho.S_4BYTE_LITERALS, |
| 2451 | 2451 | macho.S_8BYTE_LITERALS, |
| 2452 | 2452 | macho.S_16BYTE_LITERALS, |
| ... | ... | @@ -2827,7 +2827,7 @@ pub fn getDeclVAddr(self: *MachO, decl_index: Module.Decl.Index, reloc_info: Fil |
| 2827 | 2827 | |
| 2828 | 2828 | const atom = self.getAtomForSymbol(.{ .sym_index = reloc_info.parent_atom_index, .file = null }).?; |
| 2829 | 2829 | try atom.addRelocation(self, .{ |
| 2830 | .@"type" = switch (self.base.options.target.cpu.arch) { | |
| 2830 | .type = switch (self.base.options.target.cpu.arch) { | |
| 2831 | 2831 | .aarch64 => @enumToInt(macho.reloc_type_arm64.ARM64_RELOC_UNSIGNED), |
| 2832 | 2832 | .x86_64 => @enumToInt(macho.reloc_type_x86_64.X86_64_RELOC_UNSIGNED), |
| 2833 | 2833 | else => unreachable, |
| ... | ... | @@ -3345,10 +3345,10 @@ fn allocateAtom(self: *MachO, atom: *Atom, new_atom_size: u64, alignment: u64) ! |
| 3345 | 3345 | fn getSectionPrecedence(header: macho.section_64) u4 { |
| 3346 | 3346 | if (header.isCode()) { |
| 3347 | 3347 | 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; | |
| 3349 | 3349 | return 0x2; |
| 3350 | 3350 | } |
| 3351 | switch (header.@"type"()) { | |
| 3351 | switch (header.type()) { | |
| 3352 | 3352 | macho.S_NON_LAZY_SYMBOL_POINTERS, |
| 3353 | 3353 | macho.S_LAZY_SYMBOL_POINTERS, |
| 3354 | 3354 | => return 0x0, |
src/link/MachO/DebugSymbols.zig+3-3| ... | ... | @@ -47,7 +47,7 @@ strtab: StringTable(.strtab) = .{}, |
| 47 | 47 | relocs: std.ArrayListUnmanaged(Reloc) = .{}, |
| 48 | 48 | |
| 49 | 49 | pub const Reloc = struct { |
| 50 | @"type": enum { | |
| 50 | type: enum { | |
| 51 | 51 | direct_load, |
| 52 | 52 | got_load, |
| 53 | 53 | }, |
| ... | ... | @@ -188,7 +188,7 @@ pub fn flushModule(self: *DebugSymbols, allocator: Allocator, options: link.Opti |
| 188 | 188 | const module = options.module orelse return error.LinkingWithoutZigSourceUnimplemented; |
| 189 | 189 | |
| 190 | 190 | for (self.relocs.items) |*reloc| { |
| 191 | const sym = switch (reloc.@"type") { | |
| 191 | const sym = switch (reloc.type) { | |
| 192 | 192 | .direct_load => self.base.getSymbol(.{ .sym_index = reloc.target, .file = null }), |
| 193 | 193 | .got_load => blk: { |
| 194 | 194 | const got_index = self.base.got_entries_table.get(.{ |
| ... | ... | @@ -201,7 +201,7 @@ pub fn flushModule(self: *DebugSymbols, allocator: Allocator, options: link.Opti |
| 201 | 201 | }; |
| 202 | 202 | if (sym.n_value == reloc.prev_vaddr) continue; |
| 203 | 203 | |
| 204 | const sym_name = switch (reloc.@"type") { | |
| 204 | const sym_name = switch (reloc.type) { | |
| 205 | 205 | .direct_load => self.base.getSymbolName(.{ .sym_index = reloc.target, .file = null }), |
| 206 | 206 | .got_load => blk: { |
| 207 | 207 | const got_index = self.base.got_entries_table.get(.{ |
src/link/MachO/DwarfInfo.zig+1-1| ... | ... | @@ -185,7 +185,7 @@ const AbbrevEntryIterator = struct { |
| 185 | 185 | self.pos += (math.cast(usize, creader.bytes_read) orelse return error.Overflow); |
| 186 | 186 | |
| 187 | 187 | if (kind == 0) { |
| 188 | return AbbrevEntry.@"null"(); | |
| 188 | return AbbrevEntry.null(); | |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | 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"); |
| 13 | 13 | const MachO = @import("../MachO.zig"); |
| 14 | 14 | const SymbolWithLoc = MachO.SymbolWithLoc; |
| 15 | 15 | |
| 16 | @"type": u4, | |
| 16 | type: u4, | |
| 17 | 17 | target: SymbolWithLoc, |
| 18 | 18 | offset: u32, |
| 19 | 19 | addend: i64, |
| ... | ... | @@ -23,22 +23,22 @@ dirty: bool = true, |
| 23 | 23 | |
| 24 | 24 | pub fn fmtType(self: Relocation, target: std.Target) []const u8 { |
| 25 | 25 | 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)), | |
| 28 | 28 | else => unreachable, |
| 29 | 29 | } |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | pub fn getTargetAtom(self: Relocation, macho_file: *MachO) ?*Atom { |
| 33 | 33 | 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)) { | |
| 35 | 35 | .ARM64_RELOC_GOT_LOAD_PAGE21, |
| 36 | 36 | .ARM64_RELOC_GOT_LOAD_PAGEOFF12, |
| 37 | 37 | .ARM64_RELOC_POINTER_TO_GOT, |
| 38 | 38 | => return macho_file.getGotAtomForSymbol(self.target), |
| 39 | 39 | else => {}, |
| 40 | 40 | }, |
| 41 | .x86_64 => switch (@intToEnum(macho.reloc_type_x86_64, self.@"type")) { | |
| 41 | .x86_64 => switch (@intToEnum(macho.reloc_type_x86_64, self.type)) { | |
| 42 | 42 | .X86_64_RELOC_GOT, |
| 43 | 43 | .X86_64_RELOC_GOT_LOAD, |
| 44 | 44 | => return macho_file.getGotAtomForSymbol(self.target), |
| ... | ... | @@ -79,7 +79,7 @@ fn resolveAarch64( |
| 79 | 79 | target_addr: i64, |
| 80 | 80 | base_offset: u64, |
| 81 | 81 | ) !void { |
| 82 | const rel_type = @intToEnum(macho.reloc_type_arm64, self.@"type"); | |
| 82 | const rel_type = @intToEnum(macho.reloc_type_arm64, self.type); | |
| 83 | 83 | if (rel_type == .ARM64_RELOC_UNSIGNED) { |
| 84 | 84 | var buffer: [@sizeOf(u64)]u8 = undefined; |
| 85 | 85 | const code = blk: { |
| ... | ... | @@ -232,7 +232,7 @@ fn resolveX8664( |
| 232 | 232 | target_addr: i64, |
| 233 | 233 | base_offset: u64, |
| 234 | 234 | ) !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); | |
| 236 | 236 | var buffer: [@sizeOf(u64)]u8 = undefined; |
| 237 | 237 | const code = blk: { |
| 238 | 238 | switch (rel_type) { |
src/link/MachO/ZldAtom.zig+2-2| ... | ... | @@ -596,7 +596,7 @@ fn resolveRelocsArm64( |
| 596 | 596 | const is_tlv = is_tlv: { |
| 597 | 597 | const source_sym = zld.getSymbol(atom.getSymbolWithLoc()); |
| 598 | 598 | 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; | |
| 600 | 600 | }; |
| 601 | 601 | const target_addr = try getRelocTargetAddress(zld, rel, target, is_tlv); |
| 602 | 602 | |
| ... | ... | @@ -877,7 +877,7 @@ fn resolveRelocsX86( |
| 877 | 877 | const is_tlv = is_tlv: { |
| 878 | 878 | const source_sym = zld.getSymbol(atom.getSymbolWithLoc()); |
| 879 | 879 | 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; | |
| 881 | 881 | }; |
| 882 | 882 | |
| 883 | 883 | 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 { |
| 107 | 107 | }; |
| 108 | 108 | const source_sect = object.getSourceSection(sect_id); |
| 109 | 109 | if (source_sect.isDontDeadStrip()) break :blk true; |
| 110 | switch (source_sect.@"type"()) { | |
| 110 | switch (source_sect.type()) { | |
| 111 | 111 | macho.S_MOD_INIT_FUNC_POINTERS, |
| 112 | 112 | macho.S_MOD_TERM_FUNC_POINTERS, |
| 113 | 113 | => break :blk true, |
src/link/MachO/zld.zig+9-9| ... | ... | @@ -396,7 +396,7 @@ pub const Zld = struct { |
| 396 | 396 | break :blk null; |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | switch (sect.@"type"()) { | |
| 399 | switch (sect.type()) { | |
| 400 | 400 | macho.S_4BYTE_LITERALS, |
| 401 | 401 | macho.S_8BYTE_LITERALS, |
| 402 | 402 | macho.S_16BYTE_LITERALS, |
| ... | ... | @@ -1701,7 +1701,7 @@ pub const Zld = struct { |
| 1701 | 1701 | break :outer; |
| 1702 | 1702 | } |
| 1703 | 1703 | } |
| 1704 | switch (header.@"type"()) { | |
| 1704 | switch (header.type()) { | |
| 1705 | 1705 | macho.S_NON_LAZY_SYMBOL_POINTERS => { |
| 1706 | 1706 | try self.writeGotPointer(count, buffer.writer()); |
| 1707 | 1707 | }, |
| ... | ... | @@ -1718,7 +1718,7 @@ pub const Zld = struct { |
| 1718 | 1718 | break :outer; |
| 1719 | 1719 | } |
| 1720 | 1720 | } |
| 1721 | if (header.@"type"() == macho.S_SYMBOL_STUBS) { | |
| 1721 | if (header.type() == macho.S_SYMBOL_STUBS) { | |
| 1722 | 1722 | try self.writeStubCode(atom_index, count, buffer.writer()); |
| 1723 | 1723 | } else if (mem.eql(u8, header.sectName(), "__stub_helper")) { |
| 1724 | 1724 | try self.writeStubHelperCode(atom_index, buffer.writer()); |
| ... | ... | @@ -1802,7 +1802,7 @@ pub const Zld = struct { |
| 1802 | 1802 | for (slice.items(.header)) |*header, sect_id| { |
| 1803 | 1803 | if (header.size == 0) continue; |
| 1804 | 1804 | 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; | |
| 1806 | 1806 | } |
| 1807 | 1807 | |
| 1808 | 1808 | var atom_index = slice.items(.first_atom_index)[sect_id]; |
| ... | ... | @@ -1830,7 +1830,7 @@ pub const Zld = struct { |
| 1830 | 1830 | if (self.requiresThunks()) { |
| 1831 | 1831 | for (slice.items(.header)) |header, sect_id| { |
| 1832 | 1832 | if (!header.isCode()) continue; |
| 1833 | if (header.@"type"() == macho.S_SYMBOL_STUBS) continue; | |
| 1833 | if (header.type() == macho.S_SYMBOL_STUBS) continue; | |
| 1834 | 1834 | if (mem.eql(u8, header.sectName(), "__stub_helper")) continue; |
| 1835 | 1835 | |
| 1836 | 1836 | // Create jump/branch range extenders if needed. |
| ... | ... | @@ -1994,10 +1994,10 @@ pub const Zld = struct { |
| 1994 | 1994 | const section_precedence: u4 = blk: { |
| 1995 | 1995 | if (header.isCode()) { |
| 1996 | 1996 | 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; | |
| 1998 | 1998 | break :blk 0x2; |
| 1999 | 1999 | } |
| 2000 | switch (header.@"type"()) { | |
| 2000 | switch (header.type()) { | |
| 2001 | 2001 | macho.S_NON_LAZY_SYMBOL_POINTERS, |
| 2002 | 2002 | macho.S_LAZY_SYMBOL_POINTERS, |
| 2003 | 2003 | => break :blk 0x0, |
| ... | ... | @@ -2121,7 +2121,7 @@ pub const Zld = struct { |
| 2121 | 2121 | |
| 2122 | 2122 | // Finally, unpack the rest. |
| 2123 | 2123 | for (slice.items(.header)) |header, sect_id| { |
| 2124 | switch (header.@"type"()) { | |
| 2124 | switch (header.type()) { | |
| 2125 | 2125 | macho.S_LITERAL_POINTERS, |
| 2126 | 2126 | macho.S_REGULAR, |
| 2127 | 2127 | macho.S_MOD_INIT_FUNC_POINTERS, |
| ... | ... | @@ -2252,7 +2252,7 @@ pub const Zld = struct { |
| 2252 | 2252 | // Finally, unpack the rest. |
| 2253 | 2253 | const slice = self.sections.slice(); |
| 2254 | 2254 | for (slice.items(.header)) |header, sect_id| { |
| 2255 | switch (header.@"type"()) { | |
| 2255 | switch (header.type()) { | |
| 2256 | 2256 | macho.S_LITERAL_POINTERS, |
| 2257 | 2257 | macho.S_REGULAR, |
| 2258 | 2258 | macho.S_MOD_INIT_FUNC_POINTERS, |
src/test.zig+4-4| ... | ... | @@ -213,7 +213,7 @@ const TestManifestConfigDefaults = struct { |
| 213 | 213 | /// |
| 214 | 214 | /// build test |
| 215 | 215 | const TestManifest = struct { |
| 216 | @"type": Type, | |
| 216 | type: Type, | |
| 217 | 217 | config_map: std.StringHashMap([]const u8), |
| 218 | 218 | trailing_bytes: []const u8 = "", |
| 219 | 219 | |
| ... | ... | @@ -294,7 +294,7 @@ const TestManifest = struct { |
| 294 | 294 | }; |
| 295 | 295 | |
| 296 | 296 | var manifest: TestManifest = .{ |
| 297 | .@"type" = tt, | |
| 297 | .type = tt, | |
| 298 | 298 | .config_map = std.StringHashMap([]const u8).init(arena), |
| 299 | 299 | }; |
| 300 | 300 | |
| ... | ... | @@ -320,7 +320,7 @@ const TestManifest = struct { |
| 320 | 320 | key: []const u8, |
| 321 | 321 | comptime T: type, |
| 322 | 322 | ) 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); | |
| 324 | 324 | return ConfigValueIterator(T){ |
| 325 | 325 | .inner = std.mem.split(u8, bytes, ","), |
| 326 | 326 | }; |
| ... | ... | @@ -1157,7 +1157,7 @@ pub const TestContext = struct { |
| 1157 | 1157 | |
| 1158 | 1158 | for (cases.items) |case_index| { |
| 1159 | 1159 | const case = &ctx.cases.items[case_index]; |
| 1160 | switch (manifest.@"type") { | |
| 1160 | switch (manifest.type) { | |
| 1161 | 1161 | .@"error" => { |
| 1162 | 1162 | const errors = try manifest.trailingAlloc(ctx.arena); |
| 1163 | 1163 | switch (strategy) { |
src/type.zig+39-39| ... | ... | @@ -80,8 +80,8 @@ pub const Type = extern union { |
| 80 | 80 | .comptime_int => return .ComptimeInt, |
| 81 | 81 | .comptime_float => return .ComptimeFloat, |
| 82 | 82 | .noreturn => return .NoReturn, |
| 83 | .@"null" => return .Null, | |
| 84 | .@"undefined" => return .Undefined, | |
| 83 | .null => return .Null, | |
| 84 | .undefined => return .Undefined, | |
| 85 | 85 | |
| 86 | 86 | .fn_noreturn_no_args => return .Fn, |
| 87 | 87 | .fn_void_no_args => return .Fn, |
| ... | ... | @@ -556,9 +556,9 @@ pub const Type = extern union { |
| 556 | 556 | .comptime_int, |
| 557 | 557 | .comptime_float, |
| 558 | 558 | .noreturn, |
| 559 | .@"null", | |
| 560 | .@"undefined", | |
| 561 | .@"anyopaque", | |
| 559 | .null, | |
| 560 | .undefined, | |
| 561 | .anyopaque, | |
| 562 | 562 | .@"anyframe", |
| 563 | 563 | .enum_literal, |
| 564 | 564 | => |a_tag| { |
| ... | ... | @@ -962,12 +962,12 @@ pub const Type = extern union { |
| 962 | 962 | .comptime_int => std.hash.autoHash(hasher, std.builtin.TypeId.ComptimeInt), |
| 963 | 963 | .comptime_float => std.hash.autoHash(hasher, std.builtin.TypeId.ComptimeFloat), |
| 964 | 964 | .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), | |
| 967 | 967 | |
| 968 | .@"anyopaque" => { | |
| 968 | .anyopaque => { | |
| 969 | 969 | std.hash.autoHash(hasher, std.builtin.TypeId.Opaque); |
| 970 | std.hash.autoHash(hasher, Tag.@"anyopaque"); | |
| 970 | std.hash.autoHash(hasher, Tag.anyopaque); | |
| 971 | 971 | }, |
| 972 | 972 | |
| 973 | 973 | .@"anyframe" => { |
| ... | ... | @@ -1299,8 +1299,8 @@ pub const Type = extern union { |
| 1299 | 1299 | .comptime_int, |
| 1300 | 1300 | .comptime_float, |
| 1301 | 1301 | .noreturn, |
| 1302 | .@"null", | |
| 1303 | .@"undefined", | |
| 1302 | .null, | |
| 1303 | .undefined, | |
| 1304 | 1304 | .fn_noreturn_no_args, |
| 1305 | 1305 | .fn_void_no_args, |
| 1306 | 1306 | .fn_naked_noreturn_no_args, |
| ... | ... | @@ -1596,8 +1596,8 @@ pub const Type = extern union { |
| 1596 | 1596 | => return writer.writeAll(@tagName(t)), |
| 1597 | 1597 | |
| 1598 | 1598 | .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)"), | |
| 1601 | 1601 | |
| 1602 | 1602 | .empty_struct, .empty_struct_literal => return writer.writeAll("struct {}"), |
| 1603 | 1603 | |
| ... | ... | @@ -1979,8 +1979,8 @@ pub const Type = extern union { |
| 1979 | 1979 | => try writer.writeAll(@tagName(t)), |
| 1980 | 1980 | |
| 1981 | 1981 | .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)"), | |
| 1984 | 1984 | .empty_struct_literal => try writer.writeAll("@TypeOf(.{})"), |
| 1985 | 1985 | |
| 1986 | 1986 | .empty_struct => { |
| ... | ... | @@ -2282,8 +2282,8 @@ pub const Type = extern union { |
| 2282 | 2282 | .comptime_int => return Value.initTag(.comptime_int_type), |
| 2283 | 2283 | .comptime_float => return Value.initTag(.comptime_float_type), |
| 2284 | 2284 | .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), | |
| 2287 | 2287 | .fn_noreturn_no_args => return Value.initTag(.fn_noreturn_no_args_type), |
| 2288 | 2288 | .fn_void_no_args => return Value.initTag(.fn_void_no_args_type), |
| 2289 | 2289 | .fn_naked_noreturn_no_args => return Value.initTag(.fn_naked_noreturn_no_args_type), |
| ... | ... | @@ -2420,8 +2420,8 @@ pub const Type = extern union { |
| 2420 | 2420 | .comptime_int, |
| 2421 | 2421 | .comptime_float, |
| 2422 | 2422 | .noreturn, |
| 2423 | .@"null", | |
| 2424 | .@"undefined", | |
| 2423 | .null, | |
| 2424 | .undefined, | |
| 2425 | 2425 | .enum_literal, |
| 2426 | 2426 | .empty_struct, |
| 2427 | 2427 | .empty_struct_literal, |
| ... | ... | @@ -2600,9 +2600,9 @@ pub const Type = extern union { |
| 2600 | 2600 | .anyopaque, |
| 2601 | 2601 | .anyerror, |
| 2602 | 2602 | .noreturn, |
| 2603 | .@"null", | |
| 2603 | .null, | |
| 2604 | 2604 | .@"anyframe", |
| 2605 | .@"undefined", | |
| 2605 | .undefined, | |
| 2606 | 2606 | .atomic_order, |
| 2607 | 2607 | .atomic_rmw_op, |
| 2608 | 2608 | .calling_convention, |
| ... | ... | @@ -3109,8 +3109,8 @@ pub const Type = extern union { |
| 3109 | 3109 | .type, |
| 3110 | 3110 | .comptime_int, |
| 3111 | 3111 | .comptime_float, |
| 3112 | .@"null", | |
| 3113 | .@"undefined", | |
| 3112 | .null, | |
| 3113 | .undefined, | |
| 3114 | 3114 | .enum_literal, |
| 3115 | 3115 | .type_info, |
| 3116 | 3116 | => return AbiAlignmentAdvanced{ .scalar = 0 }, |
| ... | ... | @@ -3231,8 +3231,8 @@ pub const Type = extern union { |
| 3231 | 3231 | .type, |
| 3232 | 3232 | .comptime_int, |
| 3233 | 3233 | .comptime_float, |
| 3234 | .@"null", | |
| 3235 | .@"undefined", | |
| 3234 | .null, | |
| 3235 | .undefined, | |
| 3236 | 3236 | .enum_literal, |
| 3237 | 3237 | .single_const_pointer_to_comptime_int, |
| 3238 | 3238 | .empty_struct_literal, |
| ... | ... | @@ -3554,8 +3554,8 @@ pub const Type = extern union { |
| 3554 | 3554 | .comptime_int => unreachable, |
| 3555 | 3555 | .comptime_float => unreachable, |
| 3556 | 3556 | .noreturn => unreachable, |
| 3557 | .@"null" => unreachable, | |
| 3558 | .@"undefined" => unreachable, | |
| 3557 | .null => unreachable, | |
| 3558 | .undefined => unreachable, | |
| 3559 | 3559 | .enum_literal => unreachable, |
| 3560 | 3560 | .single_const_pointer_to_comptime_int => unreachable, |
| 3561 | 3561 | .empty_struct => unreachable, |
| ... | ... | @@ -4157,7 +4157,7 @@ pub const Type = extern union { |
| 4157 | 4157 | .optional_single_const_pointer => ty.castPointer().?.data, |
| 4158 | 4158 | |
| 4159 | 4159 | .anyframe_T => ty.castTag(.anyframe_T).?.data, |
| 4160 | .@"anyframe" => Type.@"void", | |
| 4160 | .@"anyframe" => Type.void, | |
| 4161 | 4161 | |
| 4162 | 4162 | else => unreachable, |
| 4163 | 4163 | }; |
| ... | ... | @@ -4975,7 +4975,7 @@ pub const Type = extern union { |
| 4975 | 4975 | var buf: Payload.ElemType = undefined; |
| 4976 | 4976 | const child_ty = ty.optionalChild(&buf); |
| 4977 | 4977 | if (child_ty.isNoReturn()) { |
| 4978 | return Value.@"null"; | |
| 4978 | return Value.null; | |
| 4979 | 4979 | } else { |
| 4980 | 4980 | return null; |
| 4981 | 4981 | } |
| ... | ... | @@ -5057,8 +5057,8 @@ pub const Type = extern union { |
| 5057 | 5057 | .empty_struct, .empty_struct_literal => return Value.initTag(.empty_struct_value), |
| 5058 | 5058 | .void => return Value.initTag(.void_value), |
| 5059 | 5059 | .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), | |
| 5062 | 5062 | |
| 5063 | 5063 | .int_unsigned, .int_signed => { |
| 5064 | 5064 | if (ty.cast(Payload.Bits).?.data == 0) { |
| ... | ... | @@ -5121,8 +5121,8 @@ pub const Type = extern union { |
| 5121 | 5121 | .anyerror, |
| 5122 | 5122 | .noreturn, |
| 5123 | 5123 | .@"anyframe", |
| 5124 | .@"null", | |
| 5125 | .@"undefined", | |
| 5124 | .null, | |
| 5125 | .undefined, | |
| 5126 | 5126 | .atomic_order, |
| 5127 | 5127 | .atomic_rmw_op, |
| 5128 | 5128 | .calling_convention, |
| ... | ... | @@ -5937,8 +5937,8 @@ pub const Type = extern union { |
| 5937 | 5937 | comptime_float, |
| 5938 | 5938 | noreturn, |
| 5939 | 5939 | @"anyframe", |
| 5940 | @"null", | |
| 5941 | @"undefined", | |
| 5940 | null, | |
| 5941 | undefined, | |
| 5942 | 5942 | enum_literal, |
| 5943 | 5943 | atomic_order, |
| 5944 | 5944 | atomic_rmw_op, |
| ... | ... | @@ -6062,8 +6062,8 @@ pub const Type = extern union { |
| 6062 | 6062 | .comptime_float, |
| 6063 | 6063 | .noreturn, |
| 6064 | 6064 | .enum_literal, |
| 6065 | .@"null", | |
| 6066 | .@"undefined", | |
| 6065 | .null, | |
| 6066 | .undefined, | |
| 6067 | 6067 | .fn_noreturn_no_args, |
| 6068 | 6068 | .fn_void_no_args, |
| 6069 | 6069 | .fn_naked_noreturn_no_args, |
| ... | ... | @@ -6420,7 +6420,7 @@ pub const Type = extern union { |
| 6420 | 6420 | pub const @"type" = initTag(.type); |
| 6421 | 6421 | pub const @"anyerror" = initTag(.anyerror); |
| 6422 | 6422 | pub const @"anyopaque" = initTag(.anyopaque); |
| 6423 | pub const @"null" = initTag(.@"null"); | |
| 6423 | pub const @"null" = initTag(.null); | |
| 6424 | 6424 | |
| 6425 | 6425 | pub const err_int = Type.u16; |
| 6426 | 6426 | |
| ... | ... | @@ -6559,7 +6559,7 @@ pub const Type = extern union { |
| 6559 | 6559 | mod: *Module, |
| 6560 | 6560 | ) Allocator.Error!Type { |
| 6561 | 6561 | assert(error_set.zigTypeTag() == .ErrorSet); |
| 6562 | if (error_set.eql(Type.@"anyerror", mod) and | |
| 6562 | if (error_set.eql(Type.anyerror, mod) and | |
| 6563 | 6563 | payload.eql(Type.void, mod)) |
| 6564 | 6564 | { |
| 6565 | 6565 | return Type.initTag(.anyerror_void_error_union); |
src/value.zig+9-9| ... | ... | @@ -941,8 +941,8 @@ pub const Value = extern union { |
| 941 | 941 | .comptime_int_type => Type.initTag(.comptime_int), |
| 942 | 942 | .comptime_float_type => Type.initTag(.comptime_float), |
| 943 | 943 | .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), | |
| 946 | 946 | .fn_noreturn_no_args_type => Type.initTag(.fn_noreturn_no_args), |
| 947 | 947 | .fn_void_no_args_type => Type.initTag(.fn_void_no_args), |
| 948 | 948 | .fn_naked_noreturn_no_args_type => Type.initTag(.fn_naked_noreturn_no_args), |
| ... | ... | @@ -1437,12 +1437,12 @@ pub const Value = extern union { |
| 1437 | 1437 | const target = mod.getTarget(); |
| 1438 | 1438 | const endian = target.cpu.arch.endian(); |
| 1439 | 1439 | switch (ty.zigTypeTag()) { |
| 1440 | .Void => return Value.@"void", | |
| 1440 | .Void => return Value.void, | |
| 1441 | 1441 | .Bool => { |
| 1442 | 1442 | if (buffer[0] == 0) { |
| 1443 | return Value.@"false"; | |
| 1443 | return Value.false; | |
| 1444 | 1444 | } else { |
| 1445 | return Value.@"true"; | |
| 1445 | return Value.true; | |
| 1446 | 1446 | } |
| 1447 | 1447 | }, |
| 1448 | 1448 | .Int, .Enum => { |
| ... | ... | @@ -1542,16 +1542,16 @@ pub const Value = extern union { |
| 1542 | 1542 | const target = mod.getTarget(); |
| 1543 | 1543 | const endian = target.cpu.arch.endian(); |
| 1544 | 1544 | switch (ty.zigTypeTag()) { |
| 1545 | .Void => return Value.@"void", | |
| 1545 | .Void => return Value.void, | |
| 1546 | 1546 | .Bool => { |
| 1547 | 1547 | const byte = switch (endian) { |
| 1548 | 1548 | .Big => buffer[buffer.len - bit_offset / 8 - 1], |
| 1549 | 1549 | .Little => buffer[bit_offset / 8], |
| 1550 | 1550 | }; |
| 1551 | 1551 | if (((byte >> @intCast(u3, bit_offset % 8)) & 1) == 0) { |
| 1552 | return Value.@"false"; | |
| 1552 | return Value.false; | |
| 1553 | 1553 | } else { |
| 1554 | return Value.@"true"; | |
| 1554 | return Value.true; | |
| 1555 | 1555 | } |
| 1556 | 1556 | }, |
| 1557 | 1557 | .Int, .Enum => { |
| ... | ... | @@ -5279,7 +5279,7 @@ pub const Value = extern union { |
| 5279 | 5279 | pub const @"true" = initTag(.bool_true); |
| 5280 | 5280 | |
| 5281 | 5281 | pub fn makeBool(x: bool) Value { |
| 5282 | return if (x) Value.@"true" else Value.@"false"; | |
| 5282 | return if (x) Value.true else Value.false; | |
| 5283 | 5283 | } |
| 5284 | 5284 | |
| 5285 | 5285 | pub const RuntimeIndex = enum(u32) { |
test/behavior/bitcast.zig+1-1| ... | ... | @@ -337,7 +337,7 @@ test "comptime @bitCast packed struct to int and back" { |
| 337 | 337 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; |
| 338 | 338 | |
| 339 | 339 | const S = packed struct { |
| 340 | @"void": void = {}, | |
| 340 | void: void = {}, | |
| 341 | 341 | uint: u8 = 13, |
| 342 | 342 | uint_bit_aligned: u3 = 2, |
| 343 | 343 | iint_pos: i4 = 1, |
tools/gen_spirv_spec.zig-1| ... | ... | @@ -193,7 +193,6 @@ fn renderOpcodes( |
| 193 | 193 | try renderOperand(writer, .instruction, inst.opname, inst.operands, extended_structs); |
| 194 | 194 | } |
| 195 | 195 | try writer.writeAll("};\n}\n};\n"); |
| 196 | _ = extended_structs; | |
| 197 | 196 | } |
| 198 | 197 | |
| 199 | 198 | fn renderOperandKinds( |