mirror of
https://codeberg.org/ziglang/zig
synced 2026-11-18 07:05:05 +00:00
Air: store interned values in Air.Inst.Ref
Previously, interned values were represented as AIR instructions using the `interned` tag. Now, the AIR ref directly encodes the InternPool index. The encoding works as follows: * If the ref matches one of the static values, it corresponds to the same InternPool index. * Otherwise, if the MSB is 0, the ref corresponds to an InternPool index. * Otherwise, if the MSB is 1, the ref corresponds to an AIR instruction index (after removing the MSB). Note that since most static InternPool indices are low values (the exceptions being `.none` and `.var_args_param_type`), the first rule is almost a nop.
This commit is contained in:
parent
dae516dbdf
commit
ff37ccd298
13 changed files with 204 additions and 324 deletions
103
src/Air.zig
103
src/Air.zig
120
src/Sema.zig
120
src/Sema.zig
Loading…
Add table
Add a link
Reference in a new issue