mirror of
https://codeberg.org/ziglang/zig
synced 2026-11-18 07:05:05 +00:00
compiler: don't mutate the InternPool when printing types and values
This change at long last replaces the `Zcu.PerThread` parameters in `Type.print` and `Value.print` with `*Zcu` parameters. This required various tweaks to avoid the need to intern values when printing them. The most significant change is to `Value.pointerDerivation`, whose API and implementation has been changed quite a bit. This API is used by the C and SPIR-V backends, which I therefore also needed to update---but it seems to have been surprisingly painless overall! Most of this diff comes from replacing `fmt(pt)` with `fmt(zcu)` (plus a few more similar patterns), then following compile errors for a while to change parameters/constants/fields from `pt` to `zcu` where necessary. Actual logic changes should be limited to the following source files: * `src/print_value.zig` * `src/Type.zig` * `src/Value.zig` * `src/codegen/c.zig` * `src/codegen/spirv/CodeGen.zig`
This commit is contained in:
parent
ac77c23aff
commit
ebb8683ef1
26 changed files with 1587 additions and 1426 deletions
Loading…
Add table
Add a link
Reference in a new issue