diff options
| author | kcbanner <kcbanner@gmail.com> | 2023-10-21 16:49:30 -0400 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2023-11-07 00:49:35 +0000 |
| commit | f10499be0a16ec58d98387b49189401f2af2094f (patch) | |
| tree | 1dee8acd698e9bb489a9926004d4cdf16f7ce72d /src/codegen | |
| parent | 234693bcbba6f55ff6e975ddbedf0fad4dfaa8f1 (diff) | |
| download | zig-f10499be0a16ec58d98387b49189401f2af2094f.tar.gz zig-f10499be0a16ec58d98387b49189401f2af2094f.zip | |
sema: analyze field init bodies in a second pass
This change allows struct field inits to use layout information
of their own struct without causing a circular dependency.
`semaStructFields` caches the ranges of the init bodies in the `StructType`
trailing data. The init bodies are then resolved by `resolveStructFieldInits`,
which is called before the inits are actually required.
Within the init bodies, the struct decl's instruction is repurposed to refer
to the field type itself. This is to allow us to easily rebuild the inst_map
mapping required for the init body instructions to refer to the field type.
Thanks to @mlugg for the guidance on this one!
Diffstat (limited to 'src/codegen')
0 files changed, 0 insertions, 0 deletions
