diff options
| author | Ali Chraghi <alichraghi@proton.me> | 2023-05-15 14:22:40 +0330 |
|---|---|---|
| committer | Ali Chraghi <alichraghi@proton.me> | 2023-05-15 14:22:40 +0330 |
| commit | f8de4db8731e20995d16ec29bc0fb553e7d6f5bf (patch) | |
| tree | 188a3e11471df9f7c31bdb3a23a232b38c810adb /src | |
| parent | 9c550721e40f50b2ee44a5b1bf633ebdd50d5fd2 (diff) | |
| download | zig-f8de4db8731e20995d16ec29bc0fb553e7d6f5bf.tar.gz zig-f8de4db8731e20995d16ec29bc0fb553e7d6f5bf.zip | |
spirv: implement arithmeticTypeInfo for Enum (`@intToEnum`)
Diffstat (limited to 'src')
| -rw-r--r-- | src/codegen/spirv.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/codegen/spirv.zig b/src/codegen/spirv.zig index d7ab7ed4e0..6e95db9a68 100644 --- a/src/codegen/spirv.zig +++ b/src/codegen/spirv.zig @@ -369,6 +369,17 @@ pub const DeclGen = struct { .composite_integer, }; }, + .Enum => blk: { + var buffer: Type.Payload.Bits = undefined; + const int_ty = ty.intTagType(&buffer); + const int_info = int_ty.intInfo(target); + break :blk ArithmeticTypeInfo{ + .bits = int_info.bits, + .is_vector = false, + .signedness = int_info.signedness, + .class = .integer, + }; + }, // As of yet, there is no vector support in the self-hosted compiler. .Vector => self.todo("implement arithmeticTypeInfo for Vector", .{}), // TODO: For which types is this the case? |
