aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/c
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2025-05-30 00:22:45 -0400
committerJacob Young <jacobly0@users.noreply.github.com>2025-05-31 18:54:28 -0400
commitb483defc5a5c2f93eb8a445974ab831ae4e4b321 (patch)
tree0fa6fa6721e8731b294f8aafed6ca8f02a0242ae /src/codegen/c
parentc1e9ef9eaabb2219a3762c5957b1c63ad20bf1ed (diff)
downloadzig-b483defc5a5c2f93eb8a445974ab831ae4e4b321.tar.gz
zig-b483defc5a5c2f93eb8a445974ab831ae4e4b321.zip
Legalize: implement scalarization of binary operations
Diffstat (limited to 'src/codegen/c')
-rw-r--r--src/codegen/c/Type.zig21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/codegen/c/Type.zig b/src/codegen/c/Type.zig
index 7d3a485e2a..e5901ec626 100644
--- a/src/codegen/c/Type.zig
+++ b/src/codegen/c/Type.zig
@@ -1408,6 +1408,15 @@ pub const Pool = struct {
.bits = pt.zcu.errorSetBits(),
}, mod, kind),
+ .ptr_usize_type,
+ => return pool.getPointer(allocator, .{
+ .elem_ctype = .usize,
+ }),
+ .ptr_const_comptime_int_type,
+ => return pool.getPointer(allocator, .{
+ .elem_ctype = .void,
+ .@"const" = true,
+ }),
.manyptr_u8_type,
=> return pool.getPointer(allocator, .{
.elem_ctype = .u8,
@@ -1418,11 +1427,6 @@ pub const Pool = struct {
.elem_ctype = .u8,
.@"const" = true,
}),
- .single_const_pointer_to_comptime_int_type,
- => return pool.getPointer(allocator, .{
- .elem_ctype = .void,
- .@"const" = true,
- }),
.slice_const_u8_type,
.slice_const_u8_sentinel_0_type,
=> {
@@ -2157,11 +2161,16 @@ pub const Pool = struct {
},
.undef,
+ .undef_bool,
+ .undef_usize,
+ .undef_u1,
.zero,
.zero_usize,
+ .zero_u1,
.zero_u8,
.one,
.one_usize,
+ .one_u1,
.one_u8,
.four_u8,
.negative_one,
@@ -2172,7 +2181,7 @@ pub const Pool = struct {
.bool_false,
.empty_tuple,
.none,
- => unreachable,
+ => unreachable, // values, not types
_ => |ip_index| switch (ip.indexToKey(ip_index)) {
.int_type => |int_info| return pool.fromIntInfo(allocator, int_info, mod, kind),