diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2024-06-15 00:52:26 +0100 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2024-06-15 00:58:35 +0100 |
| commit | b8d2323b88e68bb5af061dd7e488f51aa0ae8176 (patch) | |
| tree | add6ff3944cddc07279fcf44191eb41a33abf174 /src/Compilation.zig | |
| parent | 1eaeb4a0a838a783d2060f4e5b3b26b483b26009 (diff) | |
| download | zig-b8d2323b88e68bb5af061dd7e488f51aa0ae8176.tar.gz zig-b8d2323b88e68bb5af061dd7e488f51aa0ae8176.zip | |
Sema: eliminate Block.src_decl
🦀 src_decl is gone 🦀
This commit eliminates the `src_decl` field from `Sema.Block`. This
change goes further to eliminating unnecessary responsibilities of
`Decl` in preparation for its major upcoming refactor.
The two main remaining reponsibilities had to do with namespace types:
`src_decl` was used to determine their line number and their name. The
former use case is solved by storing the line number alongside type
declarations (and reifications) in ZIR; this is actually more correct,
since previously the line number assigned to the type was really the
line number of the source declaration it was syntactically contained
within, which does not necessarily line up. Consequently, this change
makes debug info for namespace types more correct, although I am not
sure how debuggers actually utilize this line number, if at all. Naming
types was solved by a new field on `Block`, called `type_name_ctx`. In a
sense, it represents the "namespace" we are currently within, including
comptime function calls etc. We might want to revisit this in future,
since the type naming rules seem to be a bit hand-wavey right now.
As far as I can tell, there isn't any more preliminary work needed for
me to start work on the behemoth task of splitting `Zcu.Decl` into the
new `Nav` (Named Addressable Value) and `Cau` (Comptime Analysis Unit)
types. This will be a sweeping change, impacting essentially every part
of the pipeline after `AstGen`.
Diffstat (limited to 'src/Compilation.zig')
0 files changed, 0 insertions, 0 deletions
