aboutsummaryrefslogtreecommitdiff
path: root/src/Zir.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-07-31 15:55:44 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-07-31 15:55:44 -0700
commitd46446e4dfade96fe0db773ce4d8d1b7154cae92 (patch)
treeb0cb2fbc5ba6cf2d800c3a3f96cd760863b63aca /src/Zir.zig
parentd3389eadf42417deae2d9ba01f9529be861fb998 (diff)
parentff125db53d8c18a63872ebdcdf6dd9653eb3f56b (diff)
downloadzig-d46446e4dfade96fe0db773ce4d8d1b7154cae92.tar.gz
zig-d46446e4dfade96fe0db773ce4d8d1b7154cae92.zip
Merge remote-tracking branch 'origin/master' into llvm15
Diffstat (limited to 'src/Zir.zig')
-rw-r--r--src/Zir.zig13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/Zir.zig b/src/Zir.zig
index 6e9b133310..ccd677df0b 100644
--- a/src/Zir.zig
+++ b/src/Zir.zig
@@ -280,6 +280,9 @@ pub const Inst = struct {
/// break instruction in a block, and the target block is the parent.
/// Uses the `break` union field.
break_inline,
+ /// Checks that comptime control flow does not happen inside a runtime block.
+ /// Uses the `node` union field.
+ check_comptime_control_flow,
/// Function call.
/// Uses the `pl_node` union field with payload `Call`.
/// AST node is the function call.
@@ -1266,6 +1269,7 @@ pub const Inst = struct {
.repeat_inline,
.panic,
.panic_comptime,
+ .check_comptime_control_flow,
=> true,
};
}
@@ -1315,6 +1319,7 @@ pub const Inst = struct {
.set_runtime_safety,
.memcpy,
.memset,
+ .check_comptime_control_flow,
=> true,
.param,
@@ -1595,6 +1600,7 @@ pub const Inst = struct {
.bool_br_or = .bool_br,
.@"break" = .@"break",
.break_inline = .@"break",
+ .check_comptime_control_flow = .node,
.call = .pl_node,
.cmp_lt = .pl_node,
.cmp_lte = .pl_node,
@@ -1703,7 +1709,7 @@ pub const Inst = struct {
.switch_capture_multi_ref = .switch_capture,
.array_base_ptr = .un_node,
.field_base_ptr = .un_node,
- .validate_array_init_ty = .un_node,
+ .validate_array_init_ty = .pl_node,
.validate_struct_init_ty = .un_node,
.validate_struct_init = .pl_node,
.validate_struct_init_comptime = .pl_node,
@@ -3537,6 +3543,11 @@ pub const Inst = struct {
line: u32,
column: u32,
};
+
+ pub const ArrayInit = struct {
+ ty: Ref,
+ init_count: u32,
+ };
};
pub const SpecialProng = enum { none, @"else", under };