From f8de4db8731e20995d16ec29bc0fb553e7d6f5bf Mon Sep 17 00:00:00 2001 From: Ali Chraghi Date: Mon, 15 May 2023 14:22:40 +0330 Subject: spirv: implement arithmeticTypeInfo for Enum (`@intToEnum`) --- src/codegen/spirv.zig | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/codegen/spirv.zig') 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? -- cgit v1.2.3