0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00

AstGen: migrate ty result locations to coerced_ty

In most cases where AstGen is coercing to a fixed type (such as `u29`,
`type`, `std.builtin.CallingConvention) we do not necessarily require an
explicit coercion instruction. Instead, Sema knows the type that is
required, and can perform the coercion after the fact. This means we can
use the `coerced_ty` result location kind, saving unnecessary coercion
instructions and therefore ZIR bytes.

This required a few enhancements to Sema to introduce missing coercions.
This commit is contained in:
mlugg 2024-02-13 02:36:13 +00:00
commit 10784c7fc8
No known key found for this signature in database
GPG key ID: E60D96B91E86EF9F
2 changed files with 114 additions and 87 deletions