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