aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/spirv/Module.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2025-06-01 07:41:24 +0100
committermlugg <mlugg@mlugg.co.uk>2025-06-01 12:10:57 +0100
commitc1a5caa4545264b476951e844818f2abe103f41c (patch)
treefcacbb6cb46d76b9bb31a20a7c2149cb3802b7d7 /src/codegen/spirv/Module.zig
parent6daa37ded905431f3a25508a42590031b0905ab9 (diff)
downloadzig-c1a5caa4545264b476951e844818f2abe103f41c.tar.gz
zig-c1a5caa4545264b476951e844818f2abe103f41c.zip
compiler: combine `@intCast` safety checks
`castTruncatedData` was a poorly worded error (all shrinking casts "truncate bits", it's just that we assume those bits to be zext/sext of the other bits!), and `negativeToUnsigned` was a pointless distinction which forced the compiler to emit worse code (since two separate safety checks were required for casting e.g. 'i32' to 'u16') and wasn't even implemented correctly. This commit combines those safety panics into one function, `integerOutOfBounds`. The name maybe isn't perfect, but that's not hugely important; what matters is the new default message, which is clearer than the old ones: "integer does not fit in destination type".
Diffstat (limited to 'src/codegen/spirv/Module.zig')
0 files changed, 0 insertions, 0 deletions