diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-08-01 12:27:22 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-08-01 12:36:04 -0700 |
| commit | 6ae0825e7f87fc9b73a4b968964196b0e164f062 (patch) | |
| tree | 9c48fd4314fda457e5c54717407f0b15ea3aff8e /src/codegen | |
| parent | 7e52a096dbace546cae89ab691741ecca45f28ce (diff) | |
| download | zig-6ae0825e7f87fc9b73a4b968964196b0e164f062.tar.gz zig-6ae0825e7f87fc9b73a4b968964196b0e164f062.zip | |
Sema: implement comptime variables
Sema now properly handles alloc_inferred and alloc_inferred_mut ZIR
instructions inside a comptime execution context. In this case it
creates Decl objects and points to them with the new `decl_ref_mut`
Value Tag. `storePtr` is updated to mutate such Decl types and values.
In this case it destroys the old arena and makes a new one, preventing
memory growth during comptime code execution.
Additionally:
* Fix `storePtr` to emit a compile error for a pointer comptime-known
to be undefined.
* Fix `storePtr` to emit runtime instructions for all the cases that a
pointer is comptime-known but does not support comptime
dereferencing, such as `@intToPtr` on a hard-coded address, or an
extern function.
* Fix `ret_coerce` not coercing inside inline function call context.
Diffstat (limited to 'src/codegen')
0 files changed, 0 insertions, 0 deletions
