| author | |
| committer | |
| log | dfb3521160eb4397b7482de68796d370230a8d11 |
| tree | f40c8351fec5f2a71e76d402a4d37fdc57f5858e |
| parent | 115c08956278b79c848e04c2f4eefca40e6cd8a3 |
This is now represented instead by a special `InternPool.Index.Tag` that
has no corresponding type/value.5 files changed, 10 insertions(+), 22 deletions(-)
src/Air.zig+3-1| ... | @@ -905,7 +905,6 @@ pub const Inst = struct { | ... | @@ -905,7 +905,6 @@ pub const Inst = struct { |
| 905 | const_slice_u8_sentinel_0_type = @enumToInt(InternPool.Index.const_slice_u8_sentinel_0_type), | 905 | const_slice_u8_sentinel_0_type = @enumToInt(InternPool.Index.const_slice_u8_sentinel_0_type), |
| 906 | anyerror_void_error_union_type = @enumToInt(InternPool.Index.anyerror_void_error_union_type), | 906 | anyerror_void_error_union_type = @enumToInt(InternPool.Index.anyerror_void_error_union_type), |
| 907 | generic_poison_type = @enumToInt(InternPool.Index.generic_poison_type), | 907 | generic_poison_type = @enumToInt(InternPool.Index.generic_poison_type), |
| 908 | var_args_param_type = @enumToInt(InternPool.Index.var_args_param_type), | ||
| 909 | empty_struct_type = @enumToInt(InternPool.Index.empty_struct_type), | 908 | empty_struct_type = @enumToInt(InternPool.Index.empty_struct_type), |
| 910 | undef = @enumToInt(InternPool.Index.undef), | 909 | undef = @enumToInt(InternPool.Index.undef), |
| 911 | zero = @enumToInt(InternPool.Index.zero), | 910 | zero = @enumToInt(InternPool.Index.zero), |
| ... | @@ -926,6 +925,9 @@ pub const Inst = struct { | ... | @@ -926,6 +925,9 @@ pub const Inst = struct { |
| 926 | empty_struct = @enumToInt(InternPool.Index.empty_struct), | 925 | empty_struct = @enumToInt(InternPool.Index.empty_struct), |
| 927 | generic_poison = @enumToInt(InternPool.Index.generic_poison), | 926 | generic_poison = @enumToInt(InternPool.Index.generic_poison), |
| 928 | 927 | ||
| 928 | /// This Ref does not correspond to any AIR instruction or constant | ||
| 929 | /// value. It is used to handle argument types of var args functions. | ||
| 930 | var_args_param_type = @enumToInt(InternPool.Index.var_args_param_type), | ||
| 929 | /// This Ref does not correspond to any AIR instruction or constant | 931 | /// This Ref does not correspond to any AIR instruction or constant |
| 930 | /// value and may instead be used as a sentinel to indicate null. | 932 | /// value and may instead be used as a sentinel to indicate null. |
| 931 | none = @enumToInt(InternPool.Index.none), | 933 | none = @enumToInt(InternPool.Index.none), |
src/InternPool.zig+2-5| ... | @@ -959,7 +959,6 @@ pub const Index = enum(u32) { | ... | @@ -959,7 +959,6 @@ pub const Index = enum(u32) { |
| 959 | const_slice_u8_sentinel_0_type, | 959 | const_slice_u8_sentinel_0_type, |
| 960 | anyerror_void_error_union_type, | 960 | anyerror_void_error_union_type, |
| 961 | generic_poison_type, | 961 | generic_poison_type, |
| 962 | var_args_param_type, | ||
| 963 | /// `@TypeOf(.{})` | 962 | /// `@TypeOf(.{})` |
| 964 | empty_struct_type, | 963 | empty_struct_type, |
| 965 | 964 | ||
| ... | @@ -1002,6 +1001,8 @@ pub const Index = enum(u32) { | ... | @@ -1002,6 +1001,8 @@ pub const Index = enum(u32) { |
| 1002 | /// is not known until generic function instantiation. | 1001 | /// is not known until generic function instantiation. |
| 1003 | generic_poison, | 1002 | generic_poison, |
| 1004 | 1003 | ||
| 1004 | /// Used by Air/Sema only. | ||
| 1005 | var_args_param_type = std.math.maxInt(u32) - 1, | ||
| 1005 | none = std.math.maxInt(u32), | 1006 | none = std.math.maxInt(u32), |
| 1006 | 1007 | ||
| 1007 | _, | 1008 | _, |
| ... | @@ -1195,9 +1196,6 @@ pub const static_keys = [_]Key{ | ... | @@ -1195,9 +1196,6 @@ pub const static_keys = [_]Key{ |
| 1195 | // generic_poison_type | 1196 | // generic_poison_type |
| 1196 | .{ .simple_type = .generic_poison }, | 1197 | .{ .simple_type = .generic_poison }, |
| 1197 | 1198 | ||
| 1198 | // var_args_param_type | ||
| 1199 | .{ .simple_type = .var_args_param }, | ||
| 1200 | |||
| 1201 | // empty_struct_type | 1199 | // empty_struct_type |
| 1202 | .{ .anon_struct_type = .{ | 1200 | .{ .anon_struct_type = .{ |
| 1203 | .types = &.{}, | 1201 | .types = &.{}, |
| ... | @@ -1570,7 +1568,6 @@ pub const SimpleType = enum(u32) { | ... | @@ -1570,7 +1568,6 @@ pub const SimpleType = enum(u32) { |
| 1570 | type_info, | 1568 | type_info, |
| 1571 | 1569 | ||
| 1572 | generic_poison, | 1570 | generic_poison, |
| 1573 | var_args_param, | ||
| 1574 | }; | 1571 | }; |
| 1575 | 1572 | ||
| 1576 | pub const SimpleValue = enum(u32) { | 1573 | pub const SimpleValue = enum(u32) { |
src/Sema.zig+2-5| ... | @@ -31657,7 +31657,6 @@ pub fn resolveTypeRequiresComptime(sema: *Sema, ty: Type) CompileError!bool { | ... | @@ -31657,7 +31657,6 @@ pub fn resolveTypeRequiresComptime(sema: *Sema, ty: Type) CompileError!bool { |
| 31657 | .anyerror, | 31657 | .anyerror, |
| 31658 | .noreturn, | 31658 | .noreturn, |
| 31659 | .generic_poison, | 31659 | .generic_poison, |
| 31660 | .var_args_param, | ||
| 31661 | .atomic_order, | 31660 | .atomic_order, |
| 31662 | .atomic_rmw_op, | 31661 | .atomic_rmw_op, |
| 31663 | .calling_convention, | 31662 | .calling_convention, |
| ... | @@ -31856,6 +31855,8 @@ pub fn resolveTypeFields(sema: *Sema, ty: Type) CompileError!Type { | ... | @@ -31856,6 +31855,8 @@ pub fn resolveTypeFields(sema: *Sema, ty: Type) CompileError!Type { |
| 31856 | const mod = sema.mod; | 31855 | const mod = sema.mod; |
| 31857 | 31856 | ||
| 31858 | switch (ty.ip_index) { | 31857 | switch (ty.ip_index) { |
| 31858 | .var_args_param_type => unreachable, | ||
| 31859 | |||
| 31859 | // TODO: After the InternPool transition is complete, change this to `unreachable`. | 31860 | // TODO: After the InternPool transition is complete, change this to `unreachable`. |
| 31860 | .none => return ty, | 31861 | .none => return ty, |
| 31861 | 31862 | ||
| ... | @@ -31909,7 +31910,6 @@ pub fn resolveTypeFields(sema: *Sema, ty: Type) CompileError!Type { | ... | @@ -31909,7 +31910,6 @@ pub fn resolveTypeFields(sema: *Sema, ty: Type) CompileError!Type { |
| 31909 | .const_slice_u8_sentinel_0_type, | 31910 | .const_slice_u8_sentinel_0_type, |
| 31910 | .anyerror_void_error_union_type, | 31911 | .anyerror_void_error_union_type, |
| 31911 | .generic_poison_type, | 31912 | .generic_poison_type, |
| 31912 | .var_args_param_type, | ||
| 31913 | .empty_struct_type, | 31913 | .empty_struct_type, |
| 31914 | => return ty, | 31914 | => return ty, |
| 31915 | 31915 | ||
| ... | @@ -33123,7 +33123,6 @@ pub fn typeHasOnePossibleValue(sema: *Sema, ty: Type) CompileError!?Value { | ... | @@ -33123,7 +33123,6 @@ pub fn typeHasOnePossibleValue(sema: *Sema, ty: Type) CompileError!?Value { |
| 33123 | .undefined => Value.undef, | 33123 | .undefined => Value.undef, |
| 33124 | 33124 | ||
| 33125 | .generic_poison => return error.GenericPoison, | 33125 | .generic_poison => return error.GenericPoison, |
| 33126 | .var_args_param => unreachable, | ||
| 33127 | }, | 33126 | }, |
| 33128 | .struct_type => |struct_type| { | 33127 | .struct_type => |struct_type| { |
| 33129 | const resolved_ty = try sema.resolveTypeFields(ty); | 33128 | const resolved_ty = try sema.resolveTypeFields(ty); |
| ... | @@ -33678,8 +33677,6 @@ pub fn typeRequiresComptime(sema: *Sema, ty: Type) CompileError!bool { | ... | @@ -33678,8 +33677,6 @@ pub fn typeRequiresComptime(sema: *Sema, ty: Type) CompileError!bool { |
| 33678 | .enum_literal, | 33677 | .enum_literal, |
| 33679 | .type_info, | 33678 | .type_info, |
| 33680 | => true, | 33679 | => true, |
| 33681 | |||
| 33682 | .var_args_param => unreachable, | ||
| 33683 | }, | 33680 | }, |
| 33684 | .struct_type => |struct_type| { | 33681 | .struct_type => |struct_type| { |
| 33685 | const struct_obj = mod.structPtrUnwrap(struct_type.index) orelse return false; | 33682 | const struct_obj = mod.structPtrUnwrap(struct_type.index) orelse return false; |
src/Zir.zig+3-1| ... | @@ -2112,7 +2112,6 @@ pub const Inst = struct { | ... | @@ -2112,7 +2112,6 @@ pub const Inst = struct { |
| 2112 | const_slice_u8_sentinel_0_type = @enumToInt(InternPool.Index.const_slice_u8_sentinel_0_type), | 2112 | const_slice_u8_sentinel_0_type = @enumToInt(InternPool.Index.const_slice_u8_sentinel_0_type), |
| 2113 | anyerror_void_error_union_type = @enumToInt(InternPool.Index.anyerror_void_error_union_type), | 2113 | anyerror_void_error_union_type = @enumToInt(InternPool.Index.anyerror_void_error_union_type), |
| 2114 | generic_poison_type = @enumToInt(InternPool.Index.generic_poison_type), | 2114 | generic_poison_type = @enumToInt(InternPool.Index.generic_poison_type), |
| 2115 | var_args_param_type = @enumToInt(InternPool.Index.var_args_param_type), | ||
| 2116 | empty_struct_type = @enumToInt(InternPool.Index.empty_struct_type), | 2115 | empty_struct_type = @enumToInt(InternPool.Index.empty_struct_type), |
| 2117 | undef = @enumToInt(InternPool.Index.undef), | 2116 | undef = @enumToInt(InternPool.Index.undef), |
| 2118 | zero = @enumToInt(InternPool.Index.zero), | 2117 | zero = @enumToInt(InternPool.Index.zero), |
| ... | @@ -2133,6 +2132,9 @@ pub const Inst = struct { | ... | @@ -2133,6 +2132,9 @@ pub const Inst = struct { |
| 2133 | empty_struct = @enumToInt(InternPool.Index.empty_struct), | 2132 | empty_struct = @enumToInt(InternPool.Index.empty_struct), |
| 2134 | generic_poison = @enumToInt(InternPool.Index.generic_poison), | 2133 | generic_poison = @enumToInt(InternPool.Index.generic_poison), |
| 2135 | 2134 | ||
| 2135 | /// This tag is here to match Air and InternPool, however it is unused | ||
| 2136 | /// for ZIR purposes. | ||
| 2137 | var_args_param_type = @enumToInt(InternPool.Index.var_args_param_type), | ||
| 2136 | /// This Ref does not correspond to any ZIR instruction or constant | 2138 | /// This Ref does not correspond to any ZIR instruction or constant |
| 2137 | /// value and may instead be used as a sentinel to indicate null. | 2139 | /// value and may instead be used as a sentinel to indicate null. |
| 2138 | none = @enumToInt(InternPool.Index.none), | 2140 | none = @enumToInt(InternPool.Index.none), |
src/type.zig-10| ... | @@ -105,7 +105,6 @@ pub const Type = struct { | ... | @@ -105,7 +105,6 @@ pub const Type = struct { |
| 105 | .type_info => .Union, | 105 | .type_info => .Union, |
| 106 | 106 | ||
| 107 | .generic_poison => return error.GenericPoison, | 107 | .generic_poison => return error.GenericPoison, |
| 108 | .var_args_param => unreachable, | ||
| 109 | }, | 108 | }, |
| 110 | 109 | ||
| 111 | // values, not types | 110 | // values, not types |
| ... | @@ -803,7 +802,6 @@ pub const Type = struct { | ... | @@ -803,7 +802,6 @@ pub const Type = struct { |
| 803 | => false, | 802 | => false, |
| 804 | 803 | ||
| 805 | .generic_poison => unreachable, | 804 | .generic_poison => unreachable, |
| 806 | .var_args_param => unreachable, | ||
| 807 | }, | 805 | }, |
| 808 | .struct_type => |struct_type| { | 806 | .struct_type => |struct_type| { |
| 809 | const struct_obj = mod.structPtrUnwrap(struct_type.index) orelse { | 807 | const struct_obj = mod.structPtrUnwrap(struct_type.index) orelse { |
| ... | @@ -952,8 +950,6 @@ pub const Type = struct { | ... | @@ -952,8 +950,6 @@ pub const Type = struct { |
| 952 | .type_info, | 950 | .type_info, |
| 953 | .generic_poison, | 951 | .generic_poison, |
| 954 | => false, | 952 | => false, |
| 955 | |||
| 956 | .var_args_param => unreachable, | ||
| 957 | }, | 953 | }, |
| 958 | .struct_type => |struct_type| { | 954 | .struct_type => |struct_type| { |
| 959 | const struct_obj = mod.structPtrUnwrap(struct_type.index) orelse { | 955 | const struct_obj = mod.structPtrUnwrap(struct_type.index) orelse { |
| ... | @@ -1198,7 +1194,6 @@ pub const Type = struct { | ... | @@ -1198,7 +1194,6 @@ pub const Type = struct { |
| 1198 | 1194 | ||
| 1199 | .noreturn => unreachable, | 1195 | .noreturn => unreachable, |
| 1200 | .generic_poison => unreachable, | 1196 | .generic_poison => unreachable, |
| 1201 | .var_args_param => unreachable, | ||
| 1202 | }, | 1197 | }, |
| 1203 | .struct_type => |struct_type| { | 1198 | .struct_type => |struct_type| { |
| 1204 | const struct_obj = mod.structPtrUnwrap(struct_type.index) orelse | 1199 | const struct_obj = mod.structPtrUnwrap(struct_type.index) orelse |
| ... | @@ -1610,7 +1605,6 @@ pub const Type = struct { | ... | @@ -1610,7 +1605,6 @@ pub const Type = struct { |
| 1610 | .type_info => unreachable, | 1605 | .type_info => unreachable, |
| 1611 | .noreturn => unreachable, | 1606 | .noreturn => unreachable, |
| 1612 | .generic_poison => unreachable, | 1607 | .generic_poison => unreachable, |
| 1613 | .var_args_param => unreachable, | ||
| 1614 | }, | 1608 | }, |
| 1615 | .struct_type => |struct_type| switch (ty.containerLayout(mod)) { | 1609 | .struct_type => |struct_type| switch (ty.containerLayout(mod)) { |
| 1616 | .Packed => { | 1610 | .Packed => { |
| ... | @@ -1841,7 +1835,6 @@ pub const Type = struct { | ... | @@ -1841,7 +1835,6 @@ pub const Type = struct { |
| 1841 | .undefined => unreachable, | 1835 | .undefined => unreachable, |
| 1842 | .enum_literal => unreachable, | 1836 | .enum_literal => unreachable, |
| 1843 | .generic_poison => unreachable, | 1837 | .generic_poison => unreachable, |
| 1844 | .var_args_param => unreachable, | ||
| 1845 | 1838 | ||
| 1846 | .atomic_order => unreachable, // missing call to resolveTypeFields | 1839 | .atomic_order => unreachable, // missing call to resolveTypeFields |
| 1847 | .atomic_rmw_op => unreachable, // missing call to resolveTypeFields | 1840 | .atomic_rmw_op => unreachable, // missing call to resolveTypeFields |
| ... | @@ -2717,7 +2710,6 @@ pub const Type = struct { | ... | @@ -2717,7 +2710,6 @@ pub const Type = struct { |
| 2717 | .undefined => return Value.undef, | 2710 | .undefined => return Value.undef, |
| 2718 | 2711 | ||
| 2719 | .generic_poison => unreachable, | 2712 | .generic_poison => unreachable, |
| 2720 | .var_args_param => unreachable, | ||
| 2721 | }, | 2713 | }, |
| 2722 | .struct_type => |struct_type| { | 2714 | .struct_type => |struct_type| { |
| 2723 | if (mod.structPtrUnwrap(struct_type.index)) |s| { | 2715 | if (mod.structPtrUnwrap(struct_type.index)) |s| { |
| ... | @@ -2896,8 +2888,6 @@ pub const Type = struct { | ... | @@ -2896,8 +2888,6 @@ pub const Type = struct { |
| 2896 | .enum_literal, | 2888 | .enum_literal, |
| 2897 | .type_info, | 2889 | .type_info, |
| 2898 | => true, | 2890 | => true, |
| 2899 | |||
| 2900 | .var_args_param => unreachable, | ||
| 2901 | }, | 2891 | }, |
| 2902 | .struct_type => |struct_type| { | 2892 | .struct_type => |struct_type| { |
| 2903 | // A struct with no fields is not comptime-only. | 2893 | // A struct with no fields is not comptime-only. |