aboutsummaryrefslogtreecommitdiff
path: root/src/zig_llvm.cpp
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2024-08-18 17:57:28 +0100
committermlugg <mlugg@mlugg.co.uk>2024-08-18 18:10:59 +0100
commitde49a9a17352a36a0888b03905f207b0584fc269 (patch)
treeebda829424b7df833084bc0f8275815d42a6eeec /src/zig_llvm.cpp
parenta239d8d4e2c0e5a7f3eb4b9973f869afdb3bbe05 (diff)
downloadzig-de49a9a17352a36a0888b03905f207b0584fc269.tar.gz
zig-de49a9a17352a36a0888b03905f207b0584fc269.zip
Zir: add instructions to fetch std.builtin types
This replaces the constant `Zir.Inst.Ref` tags (and the analagous tags in `Air.Inst.Ref`, `InternPool.Index`) referring to types in `std.builtin` with a ZIR instruction `extended(builtin_type(...))` which instructs Sema to fetch such a type, effectively as if it were a shorthand for the ZIR for `@import("std").builtin.xyz`. Previously, this was achieved through constant tags in `Ref`. The analagous `InternPool` indices began as `simple_type` values, and were later rewritten to the correct type information. This system was kind of brittle, and more importantly, isn't compatible with incremental compilation of std, since incremental compilation relies on the ability to recreate types at different indices when they change. Replacing the old system with this instruction slightly increases the size of ZIR, but it simplifies logic and allows incremental compilation to work correctly on the standard library. This shouldn't have a significant impact on ZIR size or compiler performance, but I will take measurements in the PR to confirm this.
Diffstat (limited to 'src/zig_llvm.cpp')
0 files changed, 0 insertions, 0 deletions