authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-05-03 16:33:16-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-06-10 20:40:04-07:00
logbcd4bb8afbea84d86fd8758b581b141e7086b16b
tree51991831c5fe4a6ddccb2bf7297f33f72e990931
parent4cd8a40b3b34d4e68853088dd637a9da9b6a8891

stage2: move named int types to InternPool


10 files changed, 121 insertions(+), 345 deletions(-)

src/Sema.zig+6-45
...@@ -6448,7 +6448,7 @@ fn checkCallArgumentCount(...@@ -6448,7 +6448,7 @@ fn checkCallArgumentCount(
6448 .Optional => {6448 .Optional => {
6449 var buf: Type.Payload.ElemType = undefined;6449 var buf: Type.Payload.ElemType = undefined;
6450 const opt_child = callee_ty.optionalChild(&buf);6450 const opt_child = callee_ty.optionalChild(&buf);
6451 if (opt_child.zigTypeTag(mod) == .Fn or (opt_child.isSinglePointer() and6451 if (opt_child.zigTypeTag(mod) == .Fn or (opt_child.isSinglePointer(mod) and
6452 opt_child.childType().zigTypeTag(mod) == .Fn))6452 opt_child.childType().zigTypeTag(mod) == .Fn))
6453 {6453 {
6454 const msg = msg: {6454 const msg = msg: {
...@@ -31421,6 +31421,8 @@ pub fn resolveTypeRequiresComptime(sema: *Sema, ty: Type) CompileError!bool {...@@ -31421,6 +31421,8 @@ pub fn resolveTypeRequiresComptime(sema: *Sema, ty: Type) CompileError!bool {
31421 .enum_literal,31421 .enum_literal,
31422 .type_info,31422 .type_info,
31423 => true,31423 => true,
31424
31425 .var_args_param => unreachable,
31424 },31426 },
31425 .struct_type => @panic("TODO"),31427 .struct_type => @panic("TODO"),
31426 .union_type => @panic("TODO"),31428 .union_type => @panic("TODO"),
...@@ -31443,17 +31445,6 @@ pub fn resolveTypeRequiresComptime(sema: *Sema, ty: Type) CompileError!bool {...@@ -31443,17 +31445,6 @@ pub fn resolveTypeRequiresComptime(sema: *Sema, ty: Type) CompileError!bool {
31443 .i64,31445 .i64,
31444 .u128,31446 .u128,
31445 .i128,31447 .i128,
31446 .usize,
31447 .isize,
31448 .c_char,
31449 .c_short,
31450 .c_ushort,
31451 .c_int,
31452 .c_uint,
31453 .c_long,
31454 .c_ulong,
31455 .c_longlong,
31456 .c_ulonglong,
31457 .anyopaque,31448 .anyopaque,
31458 .bool,31449 .bool,
31459 .void,31450 .void,
...@@ -31798,6 +31789,7 @@ pub fn resolveTypeFields(sema: *Sema, ty: Type) CompileError!Type {...@@ -31798,6 +31789,7 @@ pub fn resolveTypeFields(sema: *Sema, ty: Type) CompileError!Type {
31798 .bool_false => unreachable,31789 .bool_false => unreachable,
31799 .empty_struct => unreachable,31790 .empty_struct => unreachable,
31800 .generic_poison => unreachable,31791 .generic_poison => unreachable,
31792 .var_args_param_type => unreachable,
3180131793
31802 .type_info_type => return sema.getBuiltinType("Type"),31794 .type_info_type => return sema.getBuiltinType("Type"),
31803 .extern_options_type => return sema.getBuiltinType("ExternOptions"),31795 .extern_options_type => return sema.getBuiltinType("ExternOptions"),
...@@ -32977,17 +32969,6 @@ pub fn typeHasOnePossibleValue(sema: *Sema, ty: Type) CompileError!?Value {...@@ -32977,17 +32969,6 @@ pub fn typeHasOnePossibleValue(sema: *Sema, ty: Type) CompileError!?Value {
32977 .i64,32969 .i64,
32978 .u128,32970 .u128,
32979 .i128,32971 .i128,
32980 .usize,
32981 .isize,
32982 .c_char,
32983 .c_short,
32984 .c_ushort,
32985 .c_int,
32986 .c_uint,
32987 .c_long,
32988 .c_ulong,
32989 .c_longlong,
32990 .c_ulonglong,
32991 .bool,32972 .bool,
32992 .type,32973 .type,
32993 .anyerror,32974 .anyerror,
...@@ -33213,17 +33194,6 @@ pub fn addType(sema: *Sema, ty: Type) !Air.Inst.Ref {...@@ -33213,17 +33194,6 @@ pub fn addType(sema: *Sema, ty: Type) !Air.Inst.Ref {
33213 .i64 => return .i64_type,33194 .i64 => return .i64_type,
33214 .u128 => return .u128_type,33195 .u128 => return .u128_type,
33215 .i128 => return .i128_type,33196 .i128 => return .i128_type,
33216 .usize => return .usize_type,
33217 .isize => return .isize_type,
33218 .c_char => return .c_char_type,
33219 .c_short => return .c_short_type,
33220 .c_ushort => return .c_ushort_type,
33221 .c_int => return .c_int_type,
33222 .c_uint => return .c_uint_type,
33223 .c_long => return .c_long_type,
33224 .c_ulong => return .c_ulong_type,
33225 .c_longlong => return .c_longlong_type,
33226 .c_ulonglong => return .c_ulonglong_type,
33227 .anyopaque => return .anyopaque_type,33197 .anyopaque => return .anyopaque_type,
33228 .bool => return .bool_type,33198 .bool => return .bool_type,
33229 .void => return .void_type,33199 .void => return .void_type,
...@@ -33664,6 +33634,8 @@ pub fn typeRequiresComptime(sema: *Sema, ty: Type) CompileError!bool {...@@ -33664,6 +33634,8 @@ pub fn typeRequiresComptime(sema: *Sema, ty: Type) CompileError!bool {
33664 .enum_literal,33634 .enum_literal,
33665 .type_info,33635 .type_info,
33666 => true,33636 => true,
33637
33638 .var_args_param => unreachable,
33667 },33639 },
33668 .struct_type => @panic("TODO"),33640 .struct_type => @panic("TODO"),
33669 .union_type => @panic("TODO"),33641 .union_type => @panic("TODO"),
...@@ -33686,17 +33658,6 @@ pub fn typeRequiresComptime(sema: *Sema, ty: Type) CompileError!bool {...@@ -33686,17 +33658,6 @@ pub fn typeRequiresComptime(sema: *Sema, ty: Type) CompileError!bool {
33686 .i64,33658 .i64,
33687 .u128,33659 .u128,
33688 .i128,33660 .i128,
33689 .usize,
33690 .isize,
33691 .c_char,
33692 .c_short,
33693 .c_ushort,
33694 .c_int,
33695 .c_uint,
33696 .c_long,
33697 .c_ulong,
33698 .c_longlong,
33699 .c_ulonglong,
33700 .anyopaque,33661 .anyopaque,
33701 .bool,33662 .bool,
33702 .void,33663 .void,
src/arch/aarch64/CodeGen.zig+3-3
...@@ -4326,7 +4326,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallModifier...@@ -4326,7 +4326,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallModifier
4326 const atom = elf_file.getAtom(atom_index);4326 const atom = elf_file.getAtom(atom_index);
4327 _ = try atom.getOrCreateOffsetTableEntry(elf_file);4327 _ = try atom.getOrCreateOffsetTableEntry(elf_file);
4328 const got_addr = @intCast(u32, atom.getOffsetTableAddress(elf_file));4328 const got_addr = @intCast(u32, atom.getOffsetTableAddress(elf_file));
4329 try self.genSetReg(Type.initTag(.usize), .x30, .{ .memory = got_addr });4329 try self.genSetReg(Type.usize, .x30, .{ .memory = got_addr });
4330 } else if (self.bin_file.cast(link.File.MachO)) |macho_file| {4330 } else if (self.bin_file.cast(link.File.MachO)) |macho_file| {
4331 const atom = try macho_file.getOrCreateAtomForDecl(func.owner_decl);4331 const atom = try macho_file.getOrCreateAtomForDecl(func.owner_decl);
4332 const sym_index = macho_file.getAtom(atom).getSymbolIndex().?;4332 const sym_index = macho_file.getAtom(atom).getSymbolIndex().?;
...@@ -4353,7 +4353,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallModifier...@@ -4353,7 +4353,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallModifier
4353 const got_addr = p9.bases.data;4353 const got_addr = p9.bases.data;
4354 const got_index = decl_block.got_index.?;4354 const got_index = decl_block.got_index.?;
4355 const fn_got_addr = got_addr + got_index * ptr_bytes;4355 const fn_got_addr = got_addr + got_index * ptr_bytes;
4356 try self.genSetReg(Type.initTag(.usize), .x30, .{ .memory = fn_got_addr });4356 try self.genSetReg(Type.usize, .x30, .{ .memory = fn_got_addr });
4357 } else unreachable;4357 } else unreachable;
43584358
4359 _ = try self.addInst(.{4359 _ = try self.addInst(.{
...@@ -5968,7 +5968,7 @@ fn airArrayToSlice(self: *Self, inst: Air.Inst.Index) !void {...@@ -5968,7 +5968,7 @@ fn airArrayToSlice(self: *Self, inst: Air.Inst.Index) !void {
59685968
5969 const stack_offset = try self.allocMem(ptr_bytes * 2, ptr_bytes * 2, inst);5969 const stack_offset = try self.allocMem(ptr_bytes * 2, ptr_bytes * 2, inst);
5970 try self.genSetStack(ptr_ty, stack_offset, ptr);5970 try self.genSetStack(ptr_ty, stack_offset, ptr);
5971 try self.genSetStack(Type.initTag(.usize), stack_offset - ptr_bytes, .{ .immediate = array_len });5971 try self.genSetStack(Type.usize, stack_offset - ptr_bytes, .{ .immediate = array_len });
5972 break :result MCValue{ .stack_offset = stack_offset };5972 break :result MCValue{ .stack_offset = stack_offset };
5973 };5973 };
5974 return self.finishAir(inst, result, .{ ty_op.operand, .none, .none });5974 return self.finishAir(inst, result, .{ ty_op.operand, .none, .none });
src/arch/arm/CodeGen.zig+5-5
...@@ -4308,7 +4308,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallModifier...@@ -4308,7 +4308,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallModifier
4308 const atom = elf_file.getAtom(atom_index);4308 const atom = elf_file.getAtom(atom_index);
4309 _ = try atom.getOrCreateOffsetTableEntry(elf_file);4309 _ = try atom.getOrCreateOffsetTableEntry(elf_file);
4310 const got_addr = @intCast(u32, atom.getOffsetTableAddress(elf_file));4310 const got_addr = @intCast(u32, atom.getOffsetTableAddress(elf_file));
4311 try self.genSetReg(Type.initTag(.usize), .lr, .{ .memory = got_addr });4311 try self.genSetReg(Type.usize, .lr, .{ .memory = got_addr });
4312 } else if (self.bin_file.cast(link.File.MachO)) |_| {4312 } else if (self.bin_file.cast(link.File.MachO)) |_| {
4313 unreachable; // unsupported architecture for MachO4313 unreachable; // unsupported architecture for MachO
4314 } else {4314 } else {
...@@ -4326,7 +4326,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallModifier...@@ -4326,7 +4326,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallModifier
4326 assert(ty.zigTypeTag(mod) == .Pointer);4326 assert(ty.zigTypeTag(mod) == .Pointer);
4327 const mcv = try self.resolveInst(callee);4327 const mcv = try self.resolveInst(callee);
43284328
4329 try self.genSetReg(Type.initTag(.usize), .lr, mcv);4329 try self.genSetReg(Type.usize, .lr, mcv);
4330 }4330 }
43314331
4332 // TODO: add Instruction.supportedOn4332 // TODO: add Instruction.supportedOn
...@@ -5694,7 +5694,7 @@ fn genSetReg(self: *Self, ty: Type, reg: Register, mcv: MCValue) InnerError!void...@@ -5694,7 +5694,7 @@ fn genSetReg(self: *Self, ty: Type, reg: Register, mcv: MCValue) InnerError!void
5694 if (extra_offset) {5694 if (extra_offset) {
5695 const offset = if (off <= math.maxInt(u8)) blk: {5695 const offset = if (off <= math.maxInt(u8)) blk: {
5696 break :blk Instruction.ExtraLoadStoreOffset.imm(@intCast(u8, off));5696 break :blk Instruction.ExtraLoadStoreOffset.imm(@intCast(u8, off));
5697 } else Instruction.ExtraLoadStoreOffset.reg(try self.copyToTmpRegister(Type.initTag(.usize), MCValue{ .immediate = off }));5697 } else Instruction.ExtraLoadStoreOffset.reg(try self.copyToTmpRegister(Type.usize, MCValue{ .immediate = off }));
56985698
5699 _ = try self.addInst(.{5699 _ = try self.addInst(.{
5700 .tag = tag,5700 .tag = tag,
...@@ -5710,7 +5710,7 @@ fn genSetReg(self: *Self, ty: Type, reg: Register, mcv: MCValue) InnerError!void...@@ -5710,7 +5710,7 @@ fn genSetReg(self: *Self, ty: Type, reg: Register, mcv: MCValue) InnerError!void
5710 } else {5710 } else {
5711 const offset = if (off <= math.maxInt(u12)) blk: {5711 const offset = if (off <= math.maxInt(u12)) blk: {
5712 break :blk Instruction.Offset.imm(@intCast(u12, off));5712 break :blk Instruction.Offset.imm(@intCast(u12, off));
5713 } else Instruction.Offset.reg(try self.copyToTmpRegister(Type.initTag(.usize), MCValue{ .immediate = off }), .none);5713 } else Instruction.Offset.reg(try self.copyToTmpRegister(Type.usize, MCValue{ .immediate = off }), .none);
57145714
5715 _ = try self.addInst(.{5715 _ = try self.addInst(.{
5716 .tag = tag,5716 .tag = tag,
...@@ -5916,7 +5916,7 @@ fn airArrayToSlice(self: *Self, inst: Air.Inst.Index) !void {...@@ -5916,7 +5916,7 @@ fn airArrayToSlice(self: *Self, inst: Air.Inst.Index) !void {
59165916
5917 const stack_offset = try self.allocMem(8, 8, inst);5917 const stack_offset = try self.allocMem(8, 8, inst);
5918 try self.genSetStack(ptr_ty, stack_offset, ptr);5918 try self.genSetStack(ptr_ty, stack_offset, ptr);
5919 try self.genSetStack(Type.initTag(.usize), stack_offset - 4, .{ .immediate = array_len });5919 try self.genSetStack(Type.usize, stack_offset - 4, .{ .immediate = array_len });
5920 break :result MCValue{ .stack_offset = stack_offset };5920 break :result MCValue{ .stack_offset = stack_offset };
5921 };5921 };
5922 return self.finishAir(inst, result, .{ ty_op.operand, .none, .none });5922 return self.finishAir(inst, result, .{ ty_op.operand, .none, .none });
src/arch/riscv64/CodeGen.zig+1-1
...@@ -1749,7 +1749,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallModifier...@@ -1749,7 +1749,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallModifier
1749 const atom = elf_file.getAtom(atom_index);1749 const atom = elf_file.getAtom(atom_index);
1750 _ = try atom.getOrCreateOffsetTableEntry(elf_file);1750 _ = try atom.getOrCreateOffsetTableEntry(elf_file);
1751 const got_addr = @intCast(u32, atom.getOffsetTableAddress(elf_file));1751 const got_addr = @intCast(u32, atom.getOffsetTableAddress(elf_file));
1752 try self.genSetReg(Type.initTag(.usize), .ra, .{ .memory = got_addr });1752 try self.genSetReg(Type.usize, .ra, .{ .memory = got_addr });
1753 _ = try self.addInst(.{1753 _ = try self.addInst(.{
1754 .tag = .jalr,1754 .tag = .jalr,
1755 .data = .{ .i_type = .{1755 .data = .{ .i_type = .{
src/arch/sparc64/CodeGen.zig+2-2
...@@ -883,7 +883,7 @@ fn airArrayToSlice(self: *Self, inst: Air.Inst.Index) !void {...@@ -883,7 +883,7 @@ fn airArrayToSlice(self: *Self, inst: Air.Inst.Index) !void {
883883
884 const stack_offset = try self.allocMem(inst, ptr_bytes * 2, ptr_bytes * 2);884 const stack_offset = try self.allocMem(inst, ptr_bytes * 2, ptr_bytes * 2);
885 try self.genSetStack(ptr_ty, stack_offset, ptr);885 try self.genSetStack(ptr_ty, stack_offset, ptr);
886 try self.genSetStack(Type.initTag(.usize), stack_offset - ptr_bytes, .{ .immediate = array_len });886 try self.genSetStack(Type.usize, stack_offset - ptr_bytes, .{ .immediate = array_len });
887 break :result MCValue{ .stack_offset = stack_offset };887 break :result MCValue{ .stack_offset = stack_offset };
888 };888 };
889 return self.finishAir(inst, result, .{ ty_op.operand, .none, .none });889 return self.finishAir(inst, result, .{ ty_op.operand, .none, .none });
...@@ -1352,7 +1352,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallModifier...@@ -1352,7 +1352,7 @@ fn airCall(self: *Self, inst: Air.Inst.Index, modifier: std.builtin.CallModifier
1352 break :blk @intCast(u32, atom.getOffsetTableAddress(elf_file));1352 break :blk @intCast(u32, atom.getOffsetTableAddress(elf_file));
1353 } else unreachable;1353 } else unreachable;
13541354
1355 try self.genSetReg(Type.initTag(.usize), .o7, .{ .memory = got_addr });1355 try self.genSetReg(Type.usize, .o7, .{ .memory = got_addr });
13561356
1357 _ = try self.addInst(.{1357 _ = try self.addInst(.{
1358 .tag = .jmpl,1358 .tag = .jmpl,
src/codegen.zig+1-1
...@@ -371,7 +371,7 @@ pub fn generateSymbol(...@@ -371,7 +371,7 @@ pub fn generateSymbol(
371371
372 // generate length372 // generate length
373 switch (try generateSymbol(bin_file, src_loc, .{373 switch (try generateSymbol(bin_file, src_loc, .{
374 .ty = Type.initTag(.usize),374 .ty = Type.usize,
375 .val = slice.len,375 .val = slice.len,
376 }, code, debug_output, reloc_info)) {376 }, code, debug_output, reloc_info)) {
377 .ok => {},377 .ok => {},
src/codegen/c/type.zig+12-12
...@@ -1359,18 +1359,18 @@ pub const CType = extern union {...@@ -1359,18 +1359,18 @@ pub const CType = extern union {
1359 self.* = undefined;1359 self.* = undefined;
1360 if (!ty.isFnOrHasRuntimeBitsIgnoreComptime(mod))1360 if (!ty.isFnOrHasRuntimeBitsIgnoreComptime(mod))
1361 self.init(.void)1361 self.init(.void)
1362 else if (ty.isAbiInt(mod)) switch (ty.tag()) {1362 else if (ty.isAbiInt(mod)) switch (ty.ip_index) {
1363 .usize => self.init(.uintptr_t),1363 .usize_type => self.init(.uintptr_t),
1364 .isize => self.init(.intptr_t),1364 .isize_type => self.init(.intptr_t),
1365 .c_char => self.init(.char),1365 .c_char_type => self.init(.char),
1366 .c_short => self.init(.short),1366 .c_short_type => self.init(.short),
1367 .c_ushort => self.init(.@"unsigned short"),1367 .c_ushort_type => self.init(.@"unsigned short"),
1368 .c_int => self.init(.int),1368 .c_int_type => self.init(.int),
1369 .c_uint => self.init(.@"unsigned int"),1369 .c_uint_type => self.init(.@"unsigned int"),
1370 .c_long => self.init(.long),1370 .c_long_type => self.init(.long),
1371 .c_ulong => self.init(.@"unsigned long"),1371 .c_ulong_type => self.init(.@"unsigned long"),
1372 .c_longlong => self.init(.@"long long"),1372 .c_longlong_type => self.init(.@"long long"),
1373 .c_ulonglong => self.init(.@"unsigned long long"),1373 .c_ulonglong_type => self.init(.@"unsigned long long"),
1374 else => switch (tagFromIntInfo(ty.intInfo(mod))) {1374 else => switch (tagFromIntInfo(ty.intInfo(mod))) {
1375 .void => unreachable,1375 .void => unreachable,
1376 else => |t| self.init(t),1376 else => |t| self.init(t),
src/codegen/spirv.zig+1-1
...@@ -2499,7 +2499,7 @@ pub const DeclGen = struct {...@@ -2499,7 +2499,7 @@ pub const DeclGen = struct {
2499 const elem_ty = ptr_ty.elemType2(mod); // use elemType() so that we get T for *[N]T.2499 const elem_ty = ptr_ty.elemType2(mod); // use elemType() so that we get T for *[N]T.
2500 const elem_ty_ref = try self.resolveType(elem_ty, .direct);2500 const elem_ty_ref = try self.resolveType(elem_ty, .direct);
2501 const elem_ptr_ty_ref = try self.spv.ptrType(elem_ty_ref, spvStorageClass(ptr_ty.ptrAddressSpace()));2501 const elem_ptr_ty_ref = try self.spv.ptrType(elem_ty_ref, spvStorageClass(ptr_ty.ptrAddressSpace()));
2502 if (ptr_ty.isSinglePointer()) {2502 if (ptr_ty.isSinglePointer(mod)) {
2503 // Pointer-to-array. In this case, the resulting pointer is not of the same type2503 // Pointer-to-array. In this case, the resulting pointer is not of the same type
2504 // as the ptr_ty (we want a *T, not a *[N]T), and hence we need to use accessChain.2504 // as the ptr_ty (we want a *T, not a *[N]T), and hence we need to use accessChain.
2505 return try self.accessChain(elem_ptr_ty_ref, ptr_id, &.{index_id});2505 return try self.accessChain(elem_ptr_ty_ref, ptr_id, &.{index_id});
src/type.zig+58-243
...@@ -121,17 +121,6 @@ pub const Type = struct {...@@ -121,17 +121,6 @@ pub const Type = struct {
121 .i64,121 .i64,
122 .u128,122 .u128,
123 .i128,123 .i128,
124 .usize,
125 .isize,
126 .c_char,
127 .c_short,
128 .c_ushort,
129 .c_int,
130 .c_uint,
131 .c_long,
132 .c_ulong,
133 .c_longlong,
134 .c_ulonglong,
135 => return .Int,124 => return .Int,
136125
137 .error_set,126 .error_set,
...@@ -621,19 +610,6 @@ pub const Type = struct {...@@ -621,19 +610,6 @@ pub const Type = struct {
621 switch (a.tag()) {610 switch (a.tag()) {
622 .generic_poison => unreachable,611 .generic_poison => unreachable,
623612
624 // Detect that e.g. u64 != usize, even if the bits match on a particular target.
625 .usize,
626 .isize,
627 .c_char,
628 .c_short,
629 .c_ushort,
630 .c_int,
631 .c_uint,
632 .c_long,
633 .c_ulong,
634 .c_longlong,
635 .c_ulonglong,
636
637 .bool,613 .bool,
638 .void,614 .void,
639 .type,615 .type,
...@@ -1013,22 +989,6 @@ pub const Type = struct {...@@ -1013,22 +989,6 @@ pub const Type = struct {
1013 switch (ty.tag()) {989 switch (ty.tag()) {
1014 .generic_poison => unreachable,990 .generic_poison => unreachable,
1015991
1016 .usize,
1017 .isize,
1018 .c_char,
1019 .c_short,
1020 .c_ushort,
1021 .c_int,
1022 .c_uint,
1023 .c_long,
1024 .c_ulong,
1025 .c_longlong,
1026 .c_ulonglong,
1027 => |ty_tag| {
1028 std.hash.autoHash(hasher, std.builtin.TypeId.Int);
1029 std.hash.autoHash(hasher, ty_tag);
1030 },
1031
1032 .bool => std.hash.autoHash(hasher, std.builtin.TypeId.Bool),992 .bool => std.hash.autoHash(hasher, std.builtin.TypeId.Bool),
1033 .void => std.hash.autoHash(hasher, std.builtin.TypeId.Void),993 .void => std.hash.autoHash(hasher, std.builtin.TypeId.Void),
1034 .type => std.hash.autoHash(hasher, std.builtin.TypeId.Type),994 .type => std.hash.autoHash(hasher, std.builtin.TypeId.Type),
...@@ -1345,17 +1305,6 @@ pub const Type = struct {...@@ -1345,17 +1305,6 @@ pub const Type = struct {
1345 .i64,1305 .i64,
1346 .u128,1306 .u128,
1347 .i128,1307 .i128,
1348 .usize,
1349 .isize,
1350 .c_char,
1351 .c_short,
1352 .c_ushort,
1353 .c_int,
1354 .c_uint,
1355 .c_long,
1356 .c_ulong,
1357 .c_longlong,
1358 .c_ulonglong,
1359 .anyopaque,1308 .anyopaque,
1360 .bool,1309 .bool,
1361 .void,1310 .void,
...@@ -1631,17 +1580,6 @@ pub const Type = struct {...@@ -1631,17 +1580,6 @@ pub const Type = struct {
1631 .i64,1580 .i64,
1632 .u128,1581 .u128,
1633 .i128,1582 .i128,
1634 .usize,
1635 .isize,
1636 .c_char,
1637 .c_short,
1638 .c_ushort,
1639 .c_int,
1640 .c_uint,
1641 .c_long,
1642 .c_ulong,
1643 .c_longlong,
1644 .c_ulonglong,
1645 .anyopaque,1583 .anyopaque,
1646 .bool,1584 .bool,
1647 .void,1585 .void,
...@@ -2020,17 +1958,6 @@ pub const Type = struct {...@@ -2020,17 +1958,6 @@ pub const Type = struct {
2020 .i64,1958 .i64,
2021 .u128,1959 .u128,
2022 .i128,1960 .i128,
2023 .usize,
2024 .isize,
2025 .c_char,
2026 .c_short,
2027 .c_ushort,
2028 .c_int,
2029 .c_uint,
2030 .c_long,
2031 .c_ulong,
2032 .c_longlong,
2033 .c_ulonglong,
2034 .anyopaque,1961 .anyopaque,
2035 .bool,1962 .bool,
2036 .void,1963 .void,
...@@ -2322,17 +2249,6 @@ pub const Type = struct {...@@ -2322,17 +2249,6 @@ pub const Type = struct {
2322 .i32 => return Value.initTag(.i32_type),2249 .i32 => return Value.initTag(.i32_type),
2323 .u64 => return Value.initTag(.u64_type),2250 .u64 => return Value.initTag(.u64_type),
2324 .i64 => return Value.initTag(.i64_type),2251 .i64 => return Value.initTag(.i64_type),
2325 .usize => return Value.initTag(.usize_type),
2326 .isize => return Value.initTag(.isize_type),
2327 .c_char => return Value.initTag(.c_char_type),
2328 .c_short => return Value.initTag(.c_short_type),
2329 .c_ushort => return Value.initTag(.c_ushort_type),
2330 .c_int => return Value.initTag(.c_int_type),
2331 .c_uint => return Value.initTag(.c_uint_type),
2332 .c_long => return Value.initTag(.c_long_type),
2333 .c_ulong => return Value.initTag(.c_ulong_type),
2334 .c_longlong => return Value.initTag(.c_longlong_type),
2335 .c_ulonglong => return Value.initTag(.c_ulonglong_type),
2336 .anyopaque => return Value.initTag(.anyopaque_type),2252 .anyopaque => return Value.initTag(.anyopaque_type),
2337 .bool => return Value.initTag(.bool_type),2253 .bool => return Value.initTag(.bool_type),
2338 .void => return Value.initTag(.void_type),2254 .void => return Value.initTag(.void_type),
...@@ -2462,17 +2378,6 @@ pub const Type = struct {...@@ -2462,17 +2378,6 @@ pub const Type = struct {
2462 .i64,2378 .i64,
2463 .u128,2379 .u128,
2464 .i128,2380 .i128,
2465 .usize,
2466 .isize,
2467 .c_char,
2468 .c_short,
2469 .c_ushort,
2470 .c_int,
2471 .c_uint,
2472 .c_long,
2473 .c_ulong,
2474 .c_longlong,
2475 .c_ulonglong,
2476 .bool,2381 .bool,
2477 .anyerror,2382 .anyerror,
2478 .const_slice_u8,2383 .const_slice_u8,
...@@ -2713,6 +2618,8 @@ pub const Type = struct {...@@ -2713,6 +2618,8 @@ pub const Type = struct {
2713 .type_info,2618 .type_info,
2714 .generic_poison,2619 .generic_poison,
2715 => false,2620 => false,
2621
2622 .var_args_param => unreachable,
2716 },2623 },
2717 .struct_type => @panic("TODO"),2624 .struct_type => @panic("TODO"),
2718 .union_type => @panic("TODO"),2625 .union_type => @panic("TODO"),
...@@ -2734,17 +2641,6 @@ pub const Type = struct {...@@ -2734,17 +2641,6 @@ pub const Type = struct {
2734 .i64,2641 .i64,
2735 .u128,2642 .u128,
2736 .i128,2643 .i128,
2737 .usize,
2738 .isize,
2739 .c_char,
2740 .c_short,
2741 .c_ushort,
2742 .c_int,
2743 .c_uint,
2744 .c_long,
2745 .c_ulong,
2746 .c_longlong,
2747 .c_ulonglong,
2748 .bool,2644 .bool,
2749 .void,2645 .void,
2750 .manyptr_u8,2646 .manyptr_u8,
...@@ -3040,7 +2936,7 @@ pub const Type = struct {...@@ -3040,7 +2936,7 @@ pub const Type = struct {
3040 .export_options,2936 .export_options,
3041 .extern_options,2937 .extern_options,
3042 .@"anyframe",2938 .@"anyframe",
3043 => return AbiAlignmentAdvanced{ .scalar = @divExact(target.cpu.arch.ptrBitWidth(), 8) },2939 => return AbiAlignmentAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) },
30442940
3045 .c_char => return AbiAlignmentAdvanced{ .scalar = target.c_type_alignment(.char) },2941 .c_char => return AbiAlignmentAdvanced{ .scalar = target.c_type_alignment(.char) },
3046 .c_short => return AbiAlignmentAdvanced{ .scalar = target.c_type_alignment(.short) },2942 .c_short => return AbiAlignmentAdvanced{ .scalar = target.c_type_alignment(.short) },
...@@ -3089,6 +2985,7 @@ pub const Type = struct {...@@ -3089,6 +2985,7 @@ pub const Type = struct {
30892985
3090 .noreturn => unreachable,2986 .noreturn => unreachable,
3091 .generic_poison => unreachable,2987 .generic_poison => unreachable,
2988 .var_args_param => unreachable,
3092 },2989 },
3093 .struct_type => @panic("TODO"),2990 .struct_type => @panic("TODO"),
3094 .union_type => @panic("TODO"),2991 .union_type => @panic("TODO"),
...@@ -3130,8 +3027,6 @@ pub const Type = struct {...@@ -3130,8 +3027,6 @@ pub const Type = struct {
3130 return AbiAlignmentAdvanced{ .scalar = target_util.defaultFunctionAlignment(target) };3027 return AbiAlignmentAdvanced{ .scalar = target_util.defaultFunctionAlignment(target) };
3131 },3028 },
31323029
3133 .isize,
3134 .usize,
3135 .single_const_pointer_to_comptime_int,3030 .single_const_pointer_to_comptime_int,
3136 .const_slice_u8,3031 .const_slice_u8,
3137 .const_slice_u8_sentinel_0,3032 .const_slice_u8_sentinel_0,
...@@ -3153,16 +3048,6 @@ pub const Type = struct {...@@ -3153,16 +3048,6 @@ pub const Type = struct {
3153 .anyframe_T,3048 .anyframe_T,
3154 => return AbiAlignmentAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) },3049 => return AbiAlignmentAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) },
31553050
3156 .c_char => return AbiAlignmentAdvanced{ .scalar = target.c_type_alignment(.char) },
3157 .c_short => return AbiAlignmentAdvanced{ .scalar = target.c_type_alignment(.short) },
3158 .c_ushort => return AbiAlignmentAdvanced{ .scalar = target.c_type_alignment(.ushort) },
3159 .c_int => return AbiAlignmentAdvanced{ .scalar = target.c_type_alignment(.int) },
3160 .c_uint => return AbiAlignmentAdvanced{ .scalar = target.c_type_alignment(.uint) },
3161 .c_long => return AbiAlignmentAdvanced{ .scalar = target.c_type_alignment(.long) },
3162 .c_ulong => return AbiAlignmentAdvanced{ .scalar = target.c_type_alignment(.ulong) },
3163 .c_longlong => return AbiAlignmentAdvanced{ .scalar = target.c_type_alignment(.longlong) },
3164 .c_ulonglong => return AbiAlignmentAdvanced{ .scalar = target.c_type_alignment(.ulonglong) },
3165
3166 // TODO revisit this when we have the concept of the error tag type3051 // TODO revisit this when we have the concept of the error tag type
3167 .anyerror_void_error_union,3052 .anyerror_void_error_union,
3168 .anyerror,3053 .anyerror,
...@@ -3491,7 +3376,7 @@ pub const Type = struct {...@@ -3491,7 +3376,7 @@ pub const Type = struct {
3491 .usize,3376 .usize,
3492 .isize,3377 .isize,
3493 .@"anyframe",3378 .@"anyframe",
3494 => return AbiSizeAdvanced{ .scalar = @divExact(target.cpu.arch.ptrBitWidth(), 8) },3379 => return AbiSizeAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) },
34953380
3496 .c_char => return AbiSizeAdvanced{ .scalar = target.c_type_byte_size(.char) },3381 .c_char => return AbiSizeAdvanced{ .scalar = target.c_type_byte_size(.char) },
3497 .c_short => return AbiSizeAdvanced{ .scalar = target.c_type_byte_size(.short) },3382 .c_short => return AbiSizeAdvanced{ .scalar = target.c_type_byte_size(.short) },
...@@ -3524,6 +3409,7 @@ pub const Type = struct {...@@ -3524,6 +3409,7 @@ pub const Type = struct {
3524 .type_info => unreachable,3409 .type_info => unreachable,
3525 .noreturn => unreachable,3410 .noreturn => unreachable,
3526 .generic_poison => unreachable,3411 .generic_poison => unreachable,
3412 .var_args_param => unreachable,
3527 },3413 },
3528 .struct_type => @panic("TODO"),3414 .struct_type => @panic("TODO"),
3529 .union_type => @panic("TODO"),3415 .union_type => @panic("TODO"),
...@@ -3666,8 +3552,6 @@ pub const Type = struct {...@@ -3666,8 +3552,6 @@ pub const Type = struct {
3666 return AbiSizeAdvanced{ .scalar = result };3552 return AbiSizeAdvanced{ .scalar = result };
3667 },3553 },
36683554
3669 .isize,
3670 .usize,
3671 .@"anyframe",3555 .@"anyframe",
3672 .anyframe_T,3556 .anyframe_T,
3673 .optional_single_const_pointer,3557 .optional_single_const_pointer,
...@@ -3694,16 +3578,6 @@ pub const Type = struct {...@@ -3694,16 +3578,6 @@ pub const Type = struct {
3694 else => return AbiSizeAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) },3578 else => return AbiSizeAdvanced{ .scalar = @divExact(target.ptrBitWidth(), 8) },
3695 },3579 },
36963580
3697 .c_char => return AbiSizeAdvanced{ .scalar = target.c_type_byte_size(.char) },
3698 .c_short => return AbiSizeAdvanced{ .scalar = target.c_type_byte_size(.short) },
3699 .c_ushort => return AbiSizeAdvanced{ .scalar = target.c_type_byte_size(.ushort) },
3700 .c_int => return AbiSizeAdvanced{ .scalar = target.c_type_byte_size(.int) },
3701 .c_uint => return AbiSizeAdvanced{ .scalar = target.c_type_byte_size(.uint) },
3702 .c_long => return AbiSizeAdvanced{ .scalar = target.c_type_byte_size(.long) },
3703 .c_ulong => return AbiSizeAdvanced{ .scalar = target.c_type_byte_size(.ulong) },
3704 .c_longlong => return AbiSizeAdvanced{ .scalar = target.c_type_byte_size(.longlong) },
3705 .c_ulonglong => return AbiSizeAdvanced{ .scalar = target.c_type_byte_size(.ulonglong) },
3706
3707 // TODO revisit this when we have the concept of the error tag type3581 // TODO revisit this when we have the concept of the error tag type
3708 .anyerror_void_error_union,3582 .anyerror_void_error_union,
3709 .anyerror,3583 .anyerror,
...@@ -3856,7 +3730,7 @@ pub const Type = struct {...@@ -3856,7 +3730,7 @@ pub const Type = struct {
3856 .usize,3730 .usize,
3857 .isize,3731 .isize,
3858 .@"anyframe",3732 .@"anyframe",
3859 => return target.cpu.arch.ptrBitWidth(),3733 => return target.ptrBitWidth(),
38603734
3861 .c_char => return target.c_type_bit_size(.char),3735 .c_char => return target.c_type_bit_size(.char),
3862 .c_short => return target.c_type_bit_size(.short),3736 .c_short => return target.c_type_bit_size(.short),
...@@ -3896,6 +3770,7 @@ pub const Type = struct {...@@ -3896,6 +3770,7 @@ pub const Type = struct {
3896 .export_options => unreachable, // missing call to resolveTypeFields3770 .export_options => unreachable, // missing call to resolveTypeFields
3897 .extern_options => unreachable, // missing call to resolveTypeFields3771 .extern_options => unreachable, // missing call to resolveTypeFields
3898 .type_info => unreachable, // missing call to resolveTypeFields3772 .type_info => unreachable, // missing call to resolveTypeFields
3773 .var_args_param => unreachable,
3899 },3774 },
3900 .struct_type => @panic("TODO"),3775 .struct_type => @panic("TODO"),
3901 .union_type => @panic("TODO"),3776 .union_type => @panic("TODO"),
...@@ -4000,8 +3875,6 @@ pub const Type = struct {...@@ -4000,8 +3875,6 @@ pub const Type = struct {
4000 return payload.len * 8 * elem_size + elem_bit_size;3875 return payload.len * 8 * elem_size + elem_bit_size;
4001 },3876 },
40023877
4003 .isize,
4004 .usize,
4005 .@"anyframe",3878 .@"anyframe",
4006 .anyframe_T,3879 .anyframe_T,
4007 => return target.ptrBitWidth(),3880 => return target.ptrBitWidth(),
...@@ -4040,16 +3913,6 @@ pub const Type = struct {...@@ -4040,16 +3913,6 @@ pub const Type = struct {
4040 .manyptr_const_u8_sentinel_0,3913 .manyptr_const_u8_sentinel_0,
4041 => return target.ptrBitWidth(),3914 => return target.ptrBitWidth(),
40423915
4043 .c_char => return target.c_type_bit_size(.char),
4044 .c_short => return target.c_type_bit_size(.short),
4045 .c_ushort => return target.c_type_bit_size(.ushort),
4046 .c_int => return target.c_type_bit_size(.int),
4047 .c_uint => return target.c_type_bit_size(.uint),
4048 .c_long => return target.c_type_bit_size(.long),
4049 .c_ulong => return target.c_type_bit_size(.ulong),
4050 .c_longlong => return target.c_type_bit_size(.longlong),
4051 .c_ulonglong => return target.c_type_bit_size(.ulonglong),
4052
4053 .error_set,3916 .error_set,
4054 .error_set_single,3917 .error_set_single,
4055 .anyerror_void_error_union,3918 .anyerror_void_error_union,
...@@ -4876,12 +4739,6 @@ pub const Type = struct {...@@ -4876,12 +4739,6 @@ pub const Type = struct {
4876 };4739 };
4877 return switch (ty.tag()) {4740 return switch (ty.tag()) {
4878 .i8,4741 .i8,
4879 .isize,
4880 .c_char,
4881 .c_short,
4882 .c_int,
4883 .c_long,
4884 .c_longlong,
4885 .i16,4742 .i16,
4886 .i32,4743 .i32,
4887 .i64,4744 .i64,
...@@ -4903,11 +4760,6 @@ pub const Type = struct {...@@ -4903,11 +4760,6 @@ pub const Type = struct {
4903 else => return false,4760 else => return false,
4904 };4761 };
4905 return switch (ty.tag()) {4762 return switch (ty.tag()) {
4906 .usize,
4907 .c_ushort,
4908 .c_uint,
4909 .c_ulong,
4910 .c_ulonglong,
4911 .u1,4763 .u1,
4912 .u8,4764 .u8,
4913 .u16,4765 .u16,
...@@ -4938,13 +4790,26 @@ pub const Type = struct {...@@ -4938,13 +4790,26 @@ pub const Type = struct {
49384790
4939 if (ty.ip_index != .none) switch (mod.intern_pool.indexToKey(ty.ip_index)) {4791 if (ty.ip_index != .none) switch (mod.intern_pool.indexToKey(ty.ip_index)) {
4940 .int_type => |int_type| return int_type,4792 .int_type => |int_type| return int_type,
4941 .ptr_type => @panic("TODO"),4793 .ptr_type => unreachable,
4942 .array_type => @panic("TODO"),4794 .array_type => unreachable,
4943 .vector_type => @panic("TODO"),4795 .vector_type => @panic("TODO"),
4944 .optional_type => @panic("TODO"),4796 .optional_type => unreachable,
4945 .error_union_type => @panic("TODO"),4797 .error_union_type => unreachable,
4946 .simple_type => @panic("TODO"),4798 .simple_type => |t| switch (t) {
4947 .struct_type => unreachable,4799 .usize => return .{ .signedness = .unsigned, .bits = target.ptrBitWidth() },
4800 .isize => return .{ .signedness = .signed, .bits = target.ptrBitWidth() },
4801 .c_char => return .{ .signedness = .signed, .bits = target.c_type_bit_size(.char) },
4802 .c_short => return .{ .signedness = .signed, .bits = target.c_type_bit_size(.short) },
4803 .c_ushort => return .{ .signedness = .unsigned, .bits = target.c_type_bit_size(.ushort) },
4804 .c_int => return .{ .signedness = .signed, .bits = target.c_type_bit_size(.int) },
4805 .c_uint => return .{ .signedness = .unsigned, .bits = target.c_type_bit_size(.uint) },
4806 .c_long => return .{ .signedness = .signed, .bits = target.c_type_bit_size(.long) },
4807 .c_ulong => return .{ .signedness = .unsigned, .bits = target.c_type_bit_size(.ulong) },
4808 .c_longlong => return .{ .signedness = .signed, .bits = target.c_type_bit_size(.longlong) },
4809 .c_ulonglong => return .{ .signedness = .unsigned, .bits = target.c_type_bit_size(.ulonglong) },
4810 else => unreachable,
4811 },
4812 .struct_type => @panic("TODO"),
4948 .union_type => unreachable,4813 .union_type => unreachable,
4949 .simple_value => unreachable,4814 .simple_value => unreachable,
4950 .extern_func => unreachable,4815 .extern_func => unreachable,
...@@ -4965,17 +4830,6 @@ pub const Type = struct {...@@ -4965,17 +4830,6 @@ pub const Type = struct {
4965 .i64 => return .{ .signedness = .signed, .bits = 64 },4830 .i64 => return .{ .signedness = .signed, .bits = 64 },
4966 .u128 => return .{ .signedness = .unsigned, .bits = 128 },4831 .u128 => return .{ .signedness = .unsigned, .bits = 128 },
4967 .i128 => return .{ .signedness = .signed, .bits = 128 },4832 .i128 => return .{ .signedness = .signed, .bits = 128 },
4968 .usize => return .{ .signedness = .unsigned, .bits = target.ptrBitWidth() },
4969 .isize => return .{ .signedness = .signed, .bits = target.ptrBitWidth() },
4970 .c_char => return .{ .signedness = .signed, .bits = target.c_type_bit_size(.char) },
4971 .c_short => return .{ .signedness = .signed, .bits = target.c_type_bit_size(.short) },
4972 .c_ushort => return .{ .signedness = .unsigned, .bits = target.c_type_bit_size(.ushort) },
4973 .c_int => return .{ .signedness = .signed, .bits = target.c_type_bit_size(.int) },
4974 .c_uint => return .{ .signedness = .unsigned, .bits = target.c_type_bit_size(.uint) },
4975 .c_long => return .{ .signedness = .signed, .bits = target.c_type_bit_size(.long) },
4976 .c_ulong => return .{ .signedness = .unsigned, .bits = target.c_type_bit_size(.ulong) },
4977 .c_longlong => return .{ .signedness = .signed, .bits = target.c_type_bit_size(.longlong) },
4978 .c_ulonglong => return .{ .signedness = .unsigned, .bits = target.c_type_bit_size(.ulonglong) },
49794833
4980 .enum_full, .enum_nonexhaustive => ty = ty.cast(Payload.EnumFull).?.data.tag_ty,4834 .enum_full, .enum_nonexhaustive => ty = ty.cast(Payload.EnumFull).?.data.tag_ty,
4981 .enum_numbered => ty = ty.castTag(.enum_numbered).?.data.tag_ty,4835 .enum_numbered => ty = ty.castTag(.enum_numbered).?.data.tag_ty,
...@@ -5003,19 +4857,19 @@ pub const Type = struct {...@@ -5003,19 +4857,19 @@ pub const Type = struct {
5003 };4857 };
5004 }4858 }
50054859
5006 pub fn isNamedInt(self: Type) bool {4860 pub fn isNamedInt(ty: Type) bool {
5007 return switch (self.tag()) {4861 return switch (ty.ip_index) {
5008 .usize,4862 .usize_type,
5009 .isize,4863 .isize_type,
5010 .c_char,4864 .c_char_type,
5011 .c_short,4865 .c_short_type,
5012 .c_ushort,4866 .c_ushort_type,
5013 .c_int,4867 .c_int_type,
5014 .c_uint,4868 .c_uint_type,
5015 .c_long,4869 .c_long_type,
5016 .c_ulong,4870 .c_ulong_type,
5017 .c_longlong,4871 .c_longlong_type,
5018 .c_ulonglong,4872 .c_ulonglong_type,
5019 => true,4873 => true,
50204874
5021 else => false,4875 else => false,
...@@ -5180,17 +5034,6 @@ pub const Type = struct {...@@ -5180,17 +5034,6 @@ pub const Type = struct {
5180 .i64,5034 .i64,
5181 .u128,5035 .u128,
5182 .i128,5036 .i128,
5183 .usize,
5184 .isize,
5185 .c_char,
5186 .c_short,
5187 .c_ushort,
5188 .c_int,
5189 .c_uint,
5190 .c_long,
5191 .c_ulong,
5192 .c_longlong,
5193 .c_ulonglong,
5194 => true,5037 => true,
51955038
5196 else => false,5039 else => false,
...@@ -5284,17 +5127,6 @@ pub const Type = struct {...@@ -5284,17 +5127,6 @@ pub const Type = struct {
5284 .i64,5127 .i64,
5285 .u128,5128 .u128,
5286 .i128,5129 .i128,
5287 .usize,
5288 .isize,
5289 .c_char,
5290 .c_short,
5291 .c_ushort,
5292 .c_int,
5293 .c_uint,
5294 .c_long,
5295 .c_ulong,
5296 .c_longlong,
5297 .c_ulonglong,
5298 .bool,5130 .bool,
5299 .type,5131 .type,
5300 .anyerror,5132 .anyerror,
...@@ -5502,6 +5334,8 @@ pub const Type = struct {...@@ -5502,6 +5334,8 @@ pub const Type = struct {
5502 .enum_literal,5334 .enum_literal,
5503 .type_info,5335 .type_info,
5504 => true,5336 => true,
5337
5338 .var_args_param => unreachable,
5505 },5339 },
5506 .struct_type => @panic("TODO"),5340 .struct_type => @panic("TODO"),
5507 .union_type => @panic("TODO"),5341 .union_type => @panic("TODO"),
...@@ -5524,17 +5358,6 @@ pub const Type = struct {...@@ -5524,17 +5358,6 @@ pub const Type = struct {
5524 .i64,5358 .i64,
5525 .u128,5359 .u128,
5526 .i128,5360 .i128,
5527 .usize,
5528 .isize,
5529 .c_char,
5530 .c_short,
5531 .c_ushort,
5532 .c_int,
5533 .c_uint,
5534 .c_long,
5535 .c_ulong,
5536 .c_longlong,
5537 .c_ulonglong,
5538 .anyopaque,5361 .anyopaque,
5539 .bool,5362 .bool,
5540 .void,5363 .void,
...@@ -6372,17 +6195,6 @@ pub const Type = struct {...@@ -6372,17 +6195,6 @@ pub const Type = struct {
6372 i64,6195 i64,
6373 u128,6196 u128,
6374 i128,6197 i128,
6375 usize,
6376 isize,
6377 c_char,
6378 c_short,
6379 c_ushort,
6380 c_int,
6381 c_uint,
6382 c_long,
6383 c_ulong,
6384 c_longlong,
6385 c_ulonglong,
6386 anyopaque,6198 anyopaque,
6387 bool,6199 bool,
6388 void,6200 void,
...@@ -6480,17 +6292,6 @@ pub const Type = struct {...@@ -6480,17 +6292,6 @@ pub const Type = struct {
6480 .i64,6292 .i64,
6481 .u128,6293 .u128,
6482 .i128,6294 .i128,
6483 .usize,
6484 .isize,
6485 .c_char,
6486 .c_short,
6487 .c_ushort,
6488 .c_int,
6489 .c_uint,
6490 .c_long,
6491 .c_ulong,
6492 .c_longlong,
6493 .c_ulonglong,
6494 .anyopaque,6295 .anyopaque,
6495 .bool,6296 .bool,
6496 .void,6297 .void,
...@@ -6859,9 +6660,13 @@ pub const Type = struct {...@@ -6859,9 +6660,13 @@ pub const Type = struct {
6859 pub const @"u29" = initTag(.u29);6660 pub const @"u29" = initTag(.u29);
6860 pub const @"u32" = initTag(.u32);6661 pub const @"u32" = initTag(.u32);
6861 pub const @"u64" = initTag(.u64);6662 pub const @"u64" = initTag(.u64);
6663 pub const @"u128" = initTag(.u128);
68626664
6665 pub const @"i8" = initTag(.i8);
6666 pub const @"i16" = initTag(.i16);
6863 pub const @"i32" = initTag(.i32);6667 pub const @"i32" = initTag(.i32);
6864 pub const @"i64" = initTag(.i64);6668 pub const @"i64" = initTag(.i64);
6669 pub const @"i128" = initTag(.i128);
68656670
6866 pub const @"f16": Type = .{ .ip_index = .f16_type, .legacy = undefined };6671 pub const @"f16": Type = .{ .ip_index = .f16_type, .legacy = undefined };
6867 pub const @"f32": Type = .{ .ip_index = .f32_type, .legacy = undefined };6672 pub const @"f32": Type = .{ .ip_index = .f32_type, .legacy = undefined };
...@@ -6870,8 +6675,8 @@ pub const Type = struct {...@@ -6870,8 +6675,8 @@ pub const Type = struct {
6870 pub const @"f128": Type = .{ .ip_index = .f128_type, .legacy = undefined };6675 pub const @"f128": Type = .{ .ip_index = .f128_type, .legacy = undefined };
68716676
6872 pub const @"bool" = initTag(.bool);6677 pub const @"bool" = initTag(.bool);
6873 pub const @"usize" = initTag(.usize);6678 pub const @"usize": Type = .{ .ip_index = .usize_type, .legacy = undefined };
6874 pub const @"isize" = initTag(.isize);6679 pub const @"isize": Type = .{ .ip_index = .isize_type, .legacy = undefined };
6875 pub const @"comptime_int": Type = .{ .ip_index = .comptime_int_type, .legacy = undefined };6680 pub const @"comptime_int": Type = .{ .ip_index = .comptime_int_type, .legacy = undefined };
6876 pub const @"comptime_float": Type = .{ .ip_index = .comptime_float_type, .legacy = undefined };6681 pub const @"comptime_float": Type = .{ .ip_index = .comptime_float_type, .legacy = undefined };
6877 pub const @"void" = initTag(.void);6682 pub const @"void" = initTag(.void);
...@@ -6879,8 +6684,18 @@ pub const Type = struct {...@@ -6879,8 +6684,18 @@ pub const Type = struct {
6879 pub const @"anyerror" = initTag(.anyerror);6684 pub const @"anyerror" = initTag(.anyerror);
6880 pub const @"anyopaque" = initTag(.anyopaque);6685 pub const @"anyopaque" = initTag(.anyopaque);
6881 pub const @"null" = initTag(.null);6686 pub const @"null" = initTag(.null);
6687 pub const @"undefined" = initTag(.undefined);
6882 pub const @"noreturn" = initTag(.noreturn);6688 pub const @"noreturn" = initTag(.noreturn);
68836689
6690 pub const @"c_char": Type = .{ .ip_index = .c_char_type, .legacy = undefined };
6691 pub const @"c_short": Type = .{ .ip_index = .c_short_type, .legacy = undefined };
6692 pub const @"c_ushort": Type = .{ .ip_index = .c_ushort_type, .legacy = undefined };
6693 pub const @"c_int": Type = .{ .ip_index = .c_int_type, .legacy = undefined };
6694 pub const @"c_uint": Type = .{ .ip_index = .c_uint_type, .legacy = undefined };
6695 pub const @"c_long": Type = .{ .ip_index = .c_long_type, .legacy = undefined };
6696 pub const @"c_ulong": Type = .{ .ip_index = .c_ulong_type, .legacy = undefined };
6697 pub const @"c_longlong": Type = .{ .ip_index = .c_longlong_type, .legacy = undefined };
6698 pub const @"c_ulonglong": Type = .{ .ip_index = .c_ulonglong_type, .legacy = undefined };
6884 pub const @"c_longdouble": Type = .{ .ip_index = .c_longdouble_type, .legacy = undefined };6699 pub const @"c_longdouble": Type = .{ .ip_index = .c_longdouble_type, .legacy = undefined };
68856700
6886 pub const err_int = Type.u16;6701 pub const err_int = Type.u16;
src/value.zig+32-32
...@@ -951,45 +951,45 @@ pub const Value = struct {...@@ -951,45 +951,45 @@ pub const Value = struct {
951 }951 }
952 return switch (self.tag()) {952 return switch (self.tag()) {
953 .ty => self.castTag(.ty).?.data,953 .ty => self.castTag(.ty).?.data,
954 .u1_type => Type.initTag(.u1),954 .u1_type => Type.u1,
955 .u8_type => Type.initTag(.u8),955 .u8_type => Type.u8,
956 .i8_type => Type.initTag(.i8),956 .i8_type => Type.i8,
957 .u16_type => Type.initTag(.u16),957 .u16_type => Type.u16,
958 .i16_type => Type.initTag(.i16),958 .i16_type => Type.i16,
959 .u29_type => Type.initTag(.u29),959 .u29_type => Type.u29,
960 .u32_type => Type.initTag(.u32),960 .u32_type => Type.u32,
961 .i32_type => Type.initTag(.i32),961 .i32_type => Type.i32,
962 .u64_type => Type.initTag(.u64),962 .u64_type => Type.u64,
963 .i64_type => Type.initTag(.i64),963 .i64_type => Type.i64,
964 .u128_type => Type.initTag(.u128),964 .u128_type => Type.u128,
965 .i128_type => Type.initTag(.i128),965 .i128_type => Type.i128,
966 .usize_type => Type.initTag(.usize),966 .usize_type => Type.usize,
967 .isize_type => Type.initTag(.isize),967 .isize_type => Type.isize,
968 .c_char_type => Type.initTag(.c_char),968 .c_char_type => Type.c_char,
969 .c_short_type => Type.initTag(.c_short),969 .c_short_type => Type.c_short,
970 .c_ushort_type => Type.initTag(.c_ushort),970 .c_ushort_type => Type.c_ushort,
971 .c_int_type => Type.initTag(.c_int),971 .c_int_type => Type.c_int,
972 .c_uint_type => Type.initTag(.c_uint),972 .c_uint_type => Type.c_uint,
973 .c_long_type => Type.initTag(.c_long),973 .c_long_type => Type.c_long,
974 .c_ulong_type => Type.initTag(.c_ulong),974 .c_ulong_type => Type.c_ulong,
975 .c_longlong_type => Type.initTag(.c_longlong),975 .c_longlong_type => Type.c_longlong,
976 .c_ulonglong_type => Type.initTag(.c_ulonglong),976 .c_ulonglong_type => Type.c_ulonglong,
977 .c_longdouble_type => Type.c_longdouble,977 .c_longdouble_type => Type.c_longdouble,
978 .f16_type => Type.f16,978 .f16_type => Type.f16,
979 .f32_type => Type.f32,979 .f32_type => Type.f32,
980 .f64_type => Type.f64,980 .f64_type => Type.f64,
981 .f80_type => Type.f80,981 .f80_type => Type.f80,
982 .f128_type => Type.f128,982 .f128_type => Type.f128,
983 .anyopaque_type => Type.initTag(.anyopaque),983 .anyopaque_type => Type.anyopaque,
984 .bool_type => Type.initTag(.bool),984 .bool_type => Type.bool,
985 .void_type => Type.initTag(.void),985 .void_type => Type.void,
986 .type_type => Type.initTag(.type),986 .type_type => Type.type,
987 .anyerror_type => Type.initTag(.anyerror),987 .anyerror_type => Type.anyerror,
988 .comptime_int_type => Type.initTag(.comptime_int),988 .comptime_int_type => Type.comptime_int,
989 .comptime_float_type => Type.comptime_float,989 .comptime_float_type => Type.comptime_float,
990 .noreturn_type => Type.initTag(.noreturn),990 .noreturn_type => Type.noreturn,
991 .null_type => Type.initTag(.null),991 .null_type => Type.null,
992 .undefined_type => Type.initTag(.undefined),992 .undefined_type => Type.undefined,
993 .single_const_pointer_to_comptime_int_type => Type.initTag(.single_const_pointer_to_comptime_int),993 .single_const_pointer_to_comptime_int_type => Type.initTag(.single_const_pointer_to_comptime_int),
994 .anyframe_type => Type.initTag(.@"anyframe"),994 .anyframe_type => Type.initTag(.@"anyframe"),
995 .const_slice_u8_type => Type.initTag(.const_slice_u8),995 .const_slice_u8_type => Type.initTag(.const_slice_u8),