authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-05-03 12:46:56-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-06-10 20:40:03-07:00
logcdf6acba961648cc800027b3e0adb0a3593a610a
tree1178d9a38680c8cc51cd075075146d8301aecd89
parentd1887ab1dde6b92e9cec374890d4c425b42ad376

InternPool: implement hasWellDefinedLayout for simple_type


1 files changed, 46 insertions(+), 1 deletions(-)

src/type.zig+46-1
...@@ -2721,7 +2721,52 @@ pub const Type = struct {...@@ -2721,7 +2721,52 @@ pub const Type = struct {
2721 .vector_type => @panic("TODO"),2721 .vector_type => @panic("TODO"),
2722 .optional_type => @panic("TODO"),2722 .optional_type => @panic("TODO"),
2723 .error_union_type => @panic("TODO"),2723 .error_union_type => @panic("TODO"),
2724 .simple_type => @panic("TODO"),2724 .simple_type => |t| return switch (t) {
2725 .f16,
2726 .f32,
2727 .f64,
2728 .f80,
2729 .f128,
2730 .usize,
2731 .isize,
2732 .c_char,
2733 .c_short,
2734 .c_ushort,
2735 .c_int,
2736 .c_uint,
2737 .c_long,
2738 .c_ulong,
2739 .c_longlong,
2740 .c_ulonglong,
2741 .c_longdouble,
2742 .bool,
2743 .void,
2744 => true,
2745
2746 .anyerror,
2747 .@"anyframe",
2748 .anyopaque,
2749 .atomic_order,
2750 .atomic_rmw_op,
2751 .calling_convention,
2752 .address_space,
2753 .float_mode,
2754 .reduce_op,
2755 .call_modifier,
2756 .prefetch_options,
2757 .export_options,
2758 .extern_options,
2759 .type,
2760 .comptime_int,
2761 .comptime_float,
2762 .noreturn,
2763 .null,
2764 .undefined,
2765 .enum_literal,
2766 .type_info,
2767 .generic_poison,
2768 => false,
2769 },
2725 .struct_type => @panic("TODO"),2770 .struct_type => @panic("TODO"),
2726 .simple_value => unreachable,2771 .simple_value => unreachable,
2727 .extern_func => unreachable,2772 .extern_func => unreachable,