structstd.zig.Zir.Inst.UnionDecl[src]

Trailing:

  1. tag_type: Ref, // if has_tag_type
  2. captures_len: u32 // if has_captures_len
  3. body_len: u32, // if has_body_len
  4. fields_len: u32, // if has_fields_len
  5. decls_len: u32, // if has_decls_len
  6. capture: Capture // for every captures_len
  7. capture_name: NullTerminatedString // for every captures_len
  8. decl: Index, // for every decls_len; points to a declaration instruction
  9. inst: Index // for every body_len
  10. has_bits: u32 // for every 8 fields
    • sets of 4 bits: 0b000X: whether corresponding field has a type expression 0b00X0: whether corresponding field has a align expression 0b0X00: whether corresponding field has a tag value expression 0bX000: unused
  11. fields: { // for every fields_len field_name: NullTerminatedString, // null terminated string index field_type: Ref, // if corresponding bit is set align: Ref, // if corresponding bit is set tag_value: Ref, // if corresponding bit is set }

Fields

fields_hash_0: u32
fields_hash_1: u32
fields_hash_2: u32
fields_hash_3: u32
src_line: u32
src_node: Ast.Node.Index

This node provides a new absolute baseline node for all instructions within this struct.

Source Code

Source code
pub const UnionDecl = struct {
    // These fields should be concatenated and reinterpreted as a `std.zig.SrcHash`.
    // This hash contains the source of all fields, and any specified attributes (`extern` etc).
    fields_hash_0: u32,
    fields_hash_1: u32,
    fields_hash_2: u32,
    fields_hash_3: u32,
    src_line: u32,
    /// This node provides a new absolute baseline node for all instructions within this struct.
    src_node: Ast.Node.Index,

    pub const Small = packed struct {
        has_tag_type: bool,
        has_captures_len: bool,
        has_body_len: bool,
        has_fields_len: bool,
        has_decls_len: bool,
        name_strategy: NameStrategy,
        layout: std.builtin.Type.ContainerLayout,
        /// has_tag_type | auto_enum_tag | result
        /// -------------------------------------
        ///    false     | false         |  union { }
        ///    false     | true          |  union(enum) { }
        ///    true      | true          |  union(enum(T)) { }
        ///    true      | false         |  union(T) { }
        auto_enum_tag: bool,
        any_aligned_fields: bool,
        _: u5 = undefined,
    };
}