diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2024-08-28 02:35:53 +0100 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2024-08-28 08:39:59 +0100 |
| commit | 0fe3fd01ddc2cd49c6a2b939577d16b9d2c65ea9 (patch) | |
| tree | 2c07fddf2b6230360fe618c4de192bc2d24eeaf7 /src/codegen/llvm/bitcode_writer.zig | |
| parent | 1a178d499537b922ff05c5d0186ed5a00dbb1a9b (diff) | |
| download | zig-0fe3fd01ddc2cd49c6a2b939577d16b9d2c65ea9.tar.gz zig-0fe3fd01ddc2cd49c6a2b939577d16b9d2c65ea9.zip | |
std: update `std.builtin.Type` fields to follow naming conventions
The compiler actually doesn't need any functional changes for this: Sema
does reification based on the tag indices of `std.builtin.Type` already!
So, no zig1.wasm update is necessary.
This change is necessary to disallow name clashes between fields and
decls on a type, which is a prerequisite of #9938.
Diffstat (limited to 'src/codegen/llvm/bitcode_writer.zig')
| -rw-r--r-- | src/codegen/llvm/bitcode_writer.zig | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/codegen/llvm/bitcode_writer.zig b/src/codegen/llvm/bitcode_writer.zig index 0b821a32e7..049a15fe17 100644 --- a/src/codegen/llvm/bitcode_writer.zig +++ b/src/codegen/llvm/bitcode_writer.zig @@ -407,14 +407,14 @@ fn charTo6Bit(c: u8) u8 { fn BufType(comptime T: type, comptime min_len: usize) type { return std.meta.Int(.unsigned, @max(min_len, @bitSizeOf(switch (@typeInfo(T)) { - .ComptimeInt => u32, - .Int => |info| if (info.signedness == .unsigned) + .comptime_int => u32, + .int => |info| if (info.signedness == .unsigned) T else @compileError("Unsupported type: " ++ @typeName(T)), - .Enum => |info| info.tag_type, - .Bool => u1, - .Struct => |info| switch (info.layout) { + .@"enum" => |info| info.tag_type, + .bool => u1, + .@"struct" => |info| switch (info.layout) { .auto, .@"extern" => @compileError("Unsupported type: " ++ @typeName(T)), .@"packed" => std.meta.Int(.unsigned, @bitSizeOf(T)), }, @@ -424,10 +424,10 @@ fn BufType(comptime T: type, comptime min_len: usize) type { fn bufValue(value: anytype, comptime min_len: usize) BufType(@TypeOf(value), min_len) { return switch (@typeInfo(@TypeOf(value))) { - .ComptimeInt, .Int => @intCast(value), - .Enum => @intFromEnum(value), - .Bool => @intFromBool(value), - .Struct => @intCast(@as(std.meta.Int(.unsigned, @bitSizeOf(@TypeOf(value))), @bitCast(value))), + .comptime_int, .int => @intCast(value), + .@"enum" => @intFromEnum(value), + .bool => @intFromBool(value), + .@"struct" => @intCast(@as(std.meta.Int(.unsigned, @bitSizeOf(@TypeOf(value))), @bitCast(value))), else => unreachable, }; } |
