Data
All instructions have an 8-byte payload, which is contained within
this union. Tag determines which union field is active, as well as
how to interpret the data within.
Fields of this type
Fields
- extended:Extended.InstData
- Used for `Tag.extended`.
- un_node:struct { /// Offset from Decl AST node index. src_node: Ast.Node.Offset, /// The meaning of this operand depends on the corresponding `Tag`. operand: Ref, }
- Used for unary operators, with an AST node source location.
- un_tok:struct { /// Offset from Decl AST token index. src_tok: Ast.TokenOffset, /// The meaning of this operand depends on the corresponding `Tag`. operand: Ref, }
- Used for unary operators, with a token source location.
- pl_node:struct { /// Offset from Decl AST node index. /// `Tag` determines which kind of AST node this points to. src_node: Ast.Node.Offset, /// index into extra. /// `Tag` determines what lives there. payload_index: u32, }
- pl_tok:struct { /// Offset from Decl AST token index. src_tok: Ast.TokenOffset, /// index into extra. /// `Tag` determines what lives there. payload_index: u32, }
- str:struct { /// Offset into `string_bytes`. start: NullTerminatedString, /// Number of bytes in the string. len: u32, pub fn get(self: @This(), code: Zir) []const u8 { return code.string_bytes[@intFromEnum(self.start)..][0..self.len]; } }
- For strings which may contain null bytes.
- str_tok:struct { /// Offset into `string_bytes`. Null-terminated. start: NullTerminatedString, /// Offset from Decl AST token index. src_tok: Ast.TokenOffset, pub fn get(self: @This(), code: Zir) [:0]const u8 { return code.nullTerminatedString(self.start); } }
- tok:Ast.TokenOffset
- Offset from Decl AST token index.
- node:Ast.Node.Offset
- Offset from Decl AST node index.
- int:u64
- float:f64
- ptr_type:struct { flags: packed struct { is_allowzero: bool, is_mutable: bool, is_volatile: bool, has_sentinel: bool, has_align: bool, has_addrspace: bool, has_bit_range: bool, _: u1 = undefined, }, size: std.builtin.Type.Pointer.Size, /// Index into extra. See `PtrType`. payload_index: u32, }
- int_type:struct { /// Offset from Decl AST node index. /// `Tag` determines which kind of AST node this points to. src_node: Ast.Node.Offset, signedness: std.builtin.Signedness, bit_count: u16, }
- @"unreachable":struct { /// Offset from Decl AST node index. /// `Tag` determines which kind of AST node this points to. src_node: Ast.Node.Offset, }
- @"break":struct { operand: Ref, /// Index of a `Break` payload. payload_index: u32, }
- inst_node:struct { /// Offset from Decl AST node index. src_node: Ast.Node.Offset, /// The meaning of this operand depends on the corresponding `Tag`. inst: Index, }
- Used for unary operators which reference an inst,
- str_op:struct { /// Offset into `string_bytes`. Null-terminated. str: NullTerminatedString, operand: Ref, pub fn getStr(self: @This(), zir: Zir) [:0]const u8 { return zir.nullTerminatedString(self.str); } }
- @"defer":struct { index: u32, len: u32, }
- defer_err_code:struct { err_code: Ref, payload_index: u32, }
- save_err_ret_index:struct { operand: Ref, // If error type (or .none), save new trace index }
- elem_val_imm:struct { /// The indexable value being accessed. operand: Ref, /// The index being accessed. idx: u32, }
- declaration:struct { /// This node provides a new absolute baseline node for all instructions within this struct. src_node: Ast.Node.Index, /// index into extra to a `Declaration` payload. payload_index: u32, }
TODO this has to be kept in sync with `Data` which we want to be an untagged
Types
- FieldEnum
- TODO this has to be kept in sync with `Data` which we want to be an untagged