aboutsummaryrefslogtreecommitdiff
path: root/src/Air.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-07-12 15:30:30 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-07-20 12:19:16 -0700
commit913393fd3b986dd262a8419341dced9ad5d9620d (patch)
tree24206439ed1abe1e7ca09a0f164d79981ea4eb2b /src/Air.zig
parentee6432537ee29485c5de6c8b0911ef1482d752a7 (diff)
downloadzig-913393fd3b986dd262a8419341dced9ad5d9620d.tar.gz
zig-913393fd3b986dd262a8419341dced9ad5d9620d.zip
stage2: first pass over Module.zig for AIR memory layout
Diffstat (limited to 'src/Air.zig')
-rw-r--r--src/Air.zig14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/Air.zig b/src/Air.zig
index 112845559d..e85f2e5c43 100644
--- a/src/Air.zig
+++ b/src/Air.zig
@@ -29,8 +29,11 @@ pub const Inst = struct {
data: Data,
pub const Tag = enum(u8) {
- /// The first N instructions in Air must be one arg instruction per function parameter.
- /// Uses the `ty` field.
+ /// The first N instructions in the main block must be one arg instruction per
+ /// function parameter. This makes function parameters participate in
+ /// liveness analysis without any special handling.
+ /// Uses the `ty_str` field.
+ /// The string is the parameter name.
arg,
/// Float or integer addition. For integers, wrapping is undefined behavior.
/// Both operands are guaranteed to be the same type, and the result type
@@ -131,6 +134,8 @@ pub const Inst = struct {
/// A comptime-known value. Uses the `ty_pl` field, payload is index of
/// `values` array.
constant,
+ /// A comptime-known type. Uses the `ty` field.
+ const_ty,
/// Notes the beginning of a source code statement and marks the line and column.
/// Result type is always void.
/// Uses the `dbg_stmt` field.
@@ -289,6 +294,11 @@ pub const Inst = struct {
// Index into a different array.
payload: u32,
},
+ ty_str: struct {
+ ty: Ref,
+ // ZIR string table index.
+ str: u32,
+ },
br: struct {
block_inst: Index,
operand: Ref,