authorgravatar for robin@voetter.nlRobin Voetter <robin@voetter.nl> 2023-10-08 21:21:15+02:00
committergravatar for robin@voetter.nlRobin Voetter <robin@voetter.nl> 2023-10-15 14:00:30+02:00
log10b8171466f6a2572cea0b8e70eba33be0020ac2
treed7e129c7128810eb21cb61482297482cf2cc84ba
parent3ca1f888980641c9d9aff02100f277833b988413
signature Signed by SSH key SHA256:CQ99aPxq+RueiL9u7z0FEki5Fm7V6T8q4PrEGmINrA4

spirv: handle errors in switch


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

src/codegen/spirv.zig+2
......@@ -3924,6 +3924,7 @@ const DeclGen = struct {
39243924 };
39253925 break :blk if (backing_bits <= 32) @as(u32, 1) else 2;
39263926 },
3927 .ErrorSet => 1,
39273928 else => return self.todo("implement switch for type {s}", .{@tagName(cond_ty.zigTypeTag(mod))}), // TODO: Figure out which types apply here, and work around them as we can only do integers.
39283929 };
39293930
......@@ -3977,6 +3978,7 @@ const DeclGen = struct {
39773978 // TODO: figure out of cond_ty is correct (something with enum literals)
39783979 break :blk (try value.intFromEnum(cond_ty, mod)).toUnsignedInt(mod); // TODO: composite integer constants
39793980 },
3981 .ErrorSet => value.getErrorInt(mod),
39803982 else => unreachable,
39813983 };
39823984 const int_lit: spec.LiteralContextDependentNumber = switch (cond_words) {