InternPool: implement hasWellDefinedLayout for simple_type

This commit is contained in:
Andrew Kelley
2023-05-03 12:46:56 -07:00
parent d1887ab1dd
commit cdf6acba96

View File

@@ -2721,7 +2721,52 @@ pub const Type = struct {
.vector_type => @panic("TODO"),
.optional_type => @panic("TODO"),
.error_union_type => @panic("TODO"),
.simple_type => @panic("TODO"),
.simple_type => |t| return switch (t) {
.f16,
.f32,
.f64,
.f80,
.f128,
.usize,
.isize,
.c_char,
.c_short,
.c_ushort,
.c_int,
.c_uint,
.c_long,
.c_ulong,
.c_longlong,
.c_ulonglong,
.c_longdouble,
.bool,
.void,
=> true,
.anyerror,
.@"anyframe",
.anyopaque,
.atomic_order,
.atomic_rmw_op,
.calling_convention,
.address_space,
.float_mode,
.reduce_op,
.call_modifier,
.prefetch_options,
.export_options,
.extern_options,
.type,
.comptime_int,
.comptime_float,
.noreturn,
.null,
.undefined,
.enum_literal,
.type_info,
.generic_poison,
=> false,
},
.struct_type => @panic("TODO"),
.simple_value => unreachable,
.extern_func => unreachable,