diff options
| author | yvt <i@yvt.jp> | 2020-05-15 18:28:58 +0900 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-07-24 13:33:17 -0700 |
| commit | d3ebd428650748e60db70dd2171cc044855814b1 (patch) | |
| tree | 877fd512be87b46adf73c8143d0c721e9d9849c0 /lib/std/json.zig | |
| parent | 3b26e508638e96997aff3d5ef2c42a917bf86cc8 (diff) | |
| download | zig-d3ebd428650748e60db70dd2171cc044855814b1.tar.gz zig-d3ebd428650748e60db70dd2171cc044855814b1.zip | |
Support taking extern pointers at comptime
This commit makes it possible to obtain pointers to `extern` variables
at comptime.
- `ir_get_var_ptr` employs several checks to determine if the given
variable is eligible for obtaining its pointer at comptime. This
commit alters these checks to consider `extern` variables, which have
runtime values, as eligible.
- After this change, it's now possible for `render_const_val` to be
called for `extern` variables. This commit modifies
`render_const_val` to suppress the value generation for `extern`
variables.
- `do_code_gen` now creates `ZigValue::llvm_global` of `extern`
variables before iterating through module-level variables so that
other module-level variables can refer to them.
This solution is incomplete since there are several cases still
failing:
- `global_var.array[n..m]`
- `&global_var.array[i]`
- `&global_var.inner_struct.value`
- `&global_array[i]`
Closes #5349
Diffstat (limited to 'lib/std/json.zig')
0 files changed, 0 insertions, 0 deletions
