From cc13864dfbeeebab7dff6ef0d38195c44005caba Mon Sep 17 00:00:00 2001 From: Robin Voetter Date: Sat, 16 Sep 2023 01:02:31 +0200 Subject: [PATCH] spirv: lower enum_tag constants --- src/codegen/spirv.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/codegen/spirv.zig b/src/codegen/spirv.zig index 1ebc09d315..e193a355d0 100644 --- a/src/codegen/spirv.zig +++ b/src/codegen/spirv.zig @@ -1146,6 +1146,11 @@ pub const DeclGen = struct { }); return result_id; }, + .enum_tag => { + const int_val = try val.intFromEnum(ty, mod); + const int_ty = ty.intTagType(mod); + return try self.constant(int_ty, int_val, repr); + }, // TODO: We can handle most pointers here (decl refs etc), because now they emit an extra // OpVariable that is not really required. else => {