aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2024-01-19 01:56:45 +0000
committermlugg <mlugg@mlugg.co.uk>2024-01-23 19:16:47 +0000
commitae845a33c04fb287ae5a7445743c2b570e40ca1f (patch)
tree65bbaa19d241453a95f7a1561d2815106cf36844 /src/Compilation.zig
parent993a83081a975464d1201597cf6f4cb7f6735284 (diff)
downloadzig-ae845a33c04fb287ae5a7445743c2b570e40ca1f.tar.gz
zig-ae845a33c04fb287ae5a7445743c2b570e40ca1f.zip
Zir: represent declarations via an instruction
This commit changes how declarations (`const`, `fn`, `usingnamespace`, etc) are represented in ZIR. Previously, these were represented in the container type's extra data (e.g. as trailing data on a `struct_decl`). However, this introduced the complexity of the ZIR mapping logic having to also correlate some ZIR extra data indices. That isn't really a problem today, but it's tricky for the introduction of `TrackedInst` in the commit following this one. Instead, these type declarations now simply contain a trailing list of ZIR indices to `declaration` instructions, which directly encode all data related to the declaration (including containing the declaration's body). Additionally, the ZIR for `align` etc have been split out into their own bodies. This is not strictly necessary, but it's much simpler to understand for an insignificant cost in bytes, and will simplify the resolution of #131 (where we may need to evaluate the pointer type, including align etc, without immediately evaluating the value body).
Diffstat (limited to 'src/Compilation.zig')
0 files changed, 0 insertions, 0 deletions