| ... | @@ -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, |
| 136 | | 125 | |
| 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, |
| 623 | | 612 | |
| 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, |
| 1015 | | 991 | |
| 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) }, |
| 3044 | | 2940 | |
| 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 { |
| 3089 | | 2985 | |
| 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 | }, |
| 3132 | | 3029 | |
| 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) }, |
| 3155 | | 3050 | |
| 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 type | 3051 | // 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) }, |
| 3495 | | 3380 | |
| 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 | }, |
| 3668 | | 3554 | |
| 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 | }, |
| 3696 | | 3580 | |
| 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 type | 3581 | // 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(), |
| 3860 | | 3734 | |
| 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 resolveTypeFields | 3770 | .export_options => unreachable, // missing call to resolveTypeFields |
| 3897 | .extern_options => unreachable, // missing call to resolveTypeFields | 3771 | .extern_options => unreachable, // missing call to resolveTypeFields |
| 3898 | .type_info => unreachable, // missing call to resolveTypeFields | 3772 | .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 | }, |
| 4002 | | 3877 | |
| 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(), |
| 4042 | | 3915 | |
| 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 { |
| 4938 | | 4790 | |
| 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) }, | | |
| 4979 | | 4833 | |
| 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 | } |
| 5005 | | 4859 | |
| 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, |
| 5020 | | 4874 | |
| 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, |
| 5195 | | 5038 | |
| 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); |
| 6862 | | 6664 | |
| | 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); |
| 6865 | | 6670 | |
| 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 }; |
| 6871 | | 6676 | |
| 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); |
| 6883 | | 6689 | |
| | 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 }; |
| 6885 | | 6700 | |
| 6886 | pub const err_int = Type.u16; | 6701 | pub const err_int = Type.u16; |