diff options
| author | Robin Voetter <robin@voetter.nl> | 2023-09-16 01:02:31 +0200 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-09-23 12:36:44 -0700 |
| commit | cc13864dfbeeebab7dff6ef0d38195c44005caba (patch) | |
| tree | e46c46b4cf925d349a55d41cef748fec5f9b5e53 /src/codegen/spirv.zig | |
| parent | aeaaa953a04c42fb2068be559155e237f7e931d2 (diff) | |
| download | zig-cc13864dfbeeebab7dff6ef0d38195c44005caba.tar.gz zig-cc13864dfbeeebab7dff6ef0d38195c44005caba.zip | |
spirv: lower enum_tag constants
Diffstat (limited to 'src/codegen/spirv.zig')
| -rw-r--r-- | src/codegen/spirv.zig | 5 |
1 files changed, 5 insertions, 0 deletions
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 => { |
