aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2024-02-14 22:01:18 +0000
committermlugg <mlugg@mlugg.co.uk>2024-02-16 11:26:34 +0000
commit260c84535546c81028cf42f1eb6ec9f17275db0f (patch)
tree566fd6156bbbbed22741b0d94b996542ee334ae6 /src/Module.zig
parent10784c7fc8d419fff943994f1aa5a454d4e43391 (diff)
downloadzig-260c84535546c81028cf42f1eb6ec9f17275db0f.tar.gz
zig-260c84535546c81028cf42f1eb6ec9f17275db0f.zip
Zir: make src_node of type declarations non-optional
Previously, the `src_node` field of `struct_decl`, `union_decl`, `enum_decl`, and `opaque_decl` was optional, included in trailing data only if a flag in `Small` was set. However, this was unnecessary logic: AstGen always provided the source node. We can simplify a few bits of logic by making this field non-optional, moving it into non-trailing data. There was one place where the field was actually omitted before: the root struct of a file was at source node 0, so the node was coincidentally elided. Therefore, this commit has a fixed cost of 4 bytes of ZIR per file.
Diffstat (limited to 'src/Module.zig')
0 files changed, 0 insertions, 0 deletions