diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-05-03 19:12:53 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-06-10 20:40:04 -0700 |
| commit | ca3cf93b21bc77535fbaa7ca6aa411654dcfe069 (patch) | |
| tree | 2bec1cb13da757280595ef217556c1eeddf77414 /src/InternPool.zig | |
| parent | 836d8a1f64cb811641e621799429c54f222717eb (diff) | |
| download | zig-ca3cf93b21bc77535fbaa7ca6aa411654dcfe069.tar.gz zig-ca3cf93b21bc77535fbaa7ca6aa411654dcfe069.zip | |
stage2: move most simple values to InternPool
Diffstat (limited to 'src/InternPool.zig')
| -rw-r--r-- | src/InternPool.zig | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/InternPool.zig b/src/InternPool.zig index 146a880493..6345d36f26 100644 --- a/src/InternPool.zig +++ b/src/InternPool.zig @@ -318,8 +318,10 @@ pub const Index = enum(u32) { type_info_type, manyptr_u8_type, manyptr_const_u8_type, + manyptr_const_u8_sentinel_0_type, single_const_pointer_to_comptime_int_type, const_slice_u8_type, + const_slice_u8_sentinel_0_type, anyerror_void_error_union_type, generic_poison_type, var_args_param_type, @@ -331,6 +333,8 @@ pub const Index = enum(u32) { zero, /// `0` (usize) zero_usize, + /// `0` (u8) + zero_u8, /// `1` (comptime_int) one, /// `1` (usize) @@ -489,24 +493,43 @@ pub const static_keys = [_]Key{ .size = .Many, } }, + // manyptr_const_u8_type .{ .ptr_type = .{ .elem_type = .u8_type, .size = .Many, .is_const = true, } }, + // manyptr_const_u8_sentinel_0_type + .{ .ptr_type = .{ + .elem_type = .u8_type, + .sentinel = .zero_u8, + .size = .Many, + .is_const = true, + } }, + .{ .ptr_type = .{ .elem_type = .comptime_int_type, .size = .One, .is_const = true, } }, + // const_slice_u8_type .{ .ptr_type = .{ .elem_type = .u8_type, .size = .Slice, .is_const = true, } }, + // const_slice_u8_sentinel_0_type + .{ .ptr_type = .{ + .elem_type = .u8_type, + .sentinel = .zero_u8, + .size = .Slice, + .is_const = true, + } }, + + // anyerror_void_error_union_type .{ .error_union_type = .{ .error_set_type = .anyerror_type, .payload_type = .void_type, @@ -542,6 +565,14 @@ pub const static_keys = [_]Key{ } }, .{ .int = .{ + .ty = .u8_type, + .big_int = .{ + .limbs = &.{0}, + .positive = true, + }, + } }, + + .{ .int = .{ .ty = .comptime_int_type, .big_int = .{ .limbs = &.{1}, |
