authorgravatar for robin@voetter.nlRobin Voetter <robin@voetter.nl> 2023-09-16 01:02:31+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-09-23 12:36:44-07:00
logcc13864dfbeeebab7dff6ef0d38195c44005caba
treee46c46b4cf925d349a55d41cef748fec5f9b5e53
parentaeaaa953a04c42fb2068be559155e237f7e931d2

spirv: lower enum_tag constants


1 files changed, 5 insertions(+), 0 deletions(-)

src/codegen/spirv.zig+5
...@@ -1146,6 +1146,11 @@ pub const DeclGen = struct {...@@ -1146,6 +1146,11 @@ pub const DeclGen = struct {
1146 });1146 });
1147 return result_id;1147 return result_id;
1148 },1148 },
1149 .enum_tag => {
1150 const int_val = try val.intFromEnum(ty, mod);
1151 const int_ty = ty.intTagType(mod);
1152 return try self.constant(int_ty, int_val, repr);
1153 },
1149 // TODO: We can handle most pointers here (decl refs etc), because now they emit an extra1154 // TODO: We can handle most pointers here (decl refs etc), because now they emit an extra
1150 // OpVariable that is not really required.1155 // OpVariable that is not really required.
1151 else => {1156 else => {