diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-05-03 12:46:56 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-06-10 20:40:03 -0700 |
| commit | cdf6acba961648cc800027b3e0adb0a3593a610a (patch) | |
| tree | 1178d9a38680c8cc51cd075075146d8301aecd89 /src/type.zig | |
| parent | d1887ab1dde6b92e9cec374890d4c425b42ad376 (diff) | |
| download | zig-cdf6acba961648cc800027b3e0adb0a3593a610a.tar.gz zig-cdf6acba961648cc800027b3e0adb0a3593a610a.zip | |
InternPool: implement hasWellDefinedLayout for simple_type
Diffstat (limited to 'src/type.zig')
| -rw-r--r-- | src/type.zig | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/src/type.zig b/src/type.zig index eaa240aa1e..027f4432f4 100644 --- a/src/type.zig +++ b/src/type.zig @@ -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, |
