diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-03-25 23:00:38 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-03-25 23:45:17 -0700 |
| commit | b2deaf80279aab1322036e55a9646ecbaaa47f44 (patch) | |
| tree | f950b7d882299bab45a6d5ea8cd213d1850c2bb0 /src/codegen.zig | |
| parent | 4bfcd105eff797aceb621d2c8b971c15fef6e450 (diff) | |
| download | zig-b2deaf80279aab1322036e55a9646ecbaaa47f44.tar.gz zig-b2deaf80279aab1322036e55a9646ecbaaa47f44.zip | |
stage2: improve source locations of Decl access
* zir.Code: introduce a decls array. This is so that `decl_val` and
`decl_ref` instructions can refer to a Decl with a u32 and therefore
they can also store a source location. This is needed for proper
compile error reporting.
* astgen uses a hash map to avoid redundantly adding a Decl to the
decls array.
* fixed reporting "instruction illegal outside function body" instead
of the desired message "unable to resolve comptime value".
* astgen skips emitting dbg_stmt instructions in comptime scopes.
* astgen has some logic to avoid adding unnecessary type coercion
instructions for common values.
Diffstat (limited to 'src/codegen.zig')
0 files changed, 0 insertions, 0 deletions
