Files
zig/src
Andrew Kelley f4d5fcde72 AstGen: avoid redundant "ref" instructions
Whenever a `ref` instruction is needed, it is created and saved in
`AstGen.ref_table` instead of being immediately appended to the current
block body. Then, when the referenced instruction is being added to the
parent block (e.g. from setBlockBody), if it has a ref_table entry, then
the ref instruction is added directly after the instruction being referenced.
This makes sure two properties are upheld:
1. All pointers to the same locals return the same address. This is required
   to be compliant with the language specification.
2. `ref` instructions will dominate their uses. This is a required property
   of ZIR.

A complication arises when a ref instruction refs another ref
instruction. The logic in appendBodyWithFixups must take this into
account, recursively handling ref refs.
2022-06-08 20:40:16 -07:00
..
2022-06-08 14:33:11 +02:00
2022-04-27 16:45:23 -07:00
2022-05-13 16:43:59 -04:00
2022-06-08 14:33:11 +02:00
2022-05-04 01:00:57 +02:00
2022-06-08 15:51:48 -07:00
2022-06-08 15:17:53 -07:00
2022-01-07 00:06:06 -05:00
2021-09-24 13:39:20 -04:00