Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Struct

DeclContents

Public Struct
std.zig.Zir.DeclContents
pub const DeclContents = struct

DeclContents contains all "interesting" instructions found within a declaration by findTrackable. These instructions are partitioned into a few different sets, since this makes ZIR instruction mapping more effective.

Fields

func_decl: ?Inst.Index

This is a simple optional because ZIR guarantees that a func/func_inferred/func_fancy instruction can only occur once per declaration.

type_decls: std.ArrayList(Inst.Index)
other: std.ArrayList(Inst.Index)

Values

Functions

pub fn clear(contents: *DeclContents) void
pub fn deinit(contents: *DeclContents, gpa: Allocator) void

File

zig/Zir.zig:4035
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
pub const DeclContents = struct {
    /// This is a simple optional because ZIR guarantees that a `func`/`func_inferred`/`func_fancy` instruction
    /// can only occur once per `declaration`.
    func_decl: ?Inst.Index,
    type_decls: std.ArrayList(Inst.Index),
    other: std.ArrayList(Inst.Index),

    pub const init: DeclContents = .{
        .func_decl = null,
        .type_decls = .empty,
        .other = .empty,
    };

    pub fn clear(contents: *DeclContents) void {
        contents.func_decl = null;
        contents.type_decls.clearRetainingCapacity();
        contents.other.clearRetainingCapacity();
    }

    pub fn deinit(contents: *DeclContents, gpa: Allocator) void {
        contents.type_decls.deinit(gpa);
        contents.other.deinit(gpa);
    }
}