struct DeclContents [src]
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.IndexThis is a simple optional because ZIR guarantees that a func/func_inferred/func_fancy instruction
can only occur once per declaration.
explicit_types: std.ArrayListUnmanaged(Inst.Index)
other: std.ArrayListUnmanaged(Inst.Index)
Members
Source
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,
explicit_types: std.ArrayListUnmanaged(Inst.Index),
other: std.ArrayListUnmanaged(Inst.Index),
pub const init: DeclContents = .{
.func_decl = null,
.explicit_types = .empty,
.other = .empty,
};
pub fn clear(contents: *DeclContents) void {
contents.func_decl = null;
contents.explicit_types.clearRetainingCapacity();
contents.other.clearRetainingCapacity();
}
pub fn deinit(contents: *DeclContents, gpa: Allocator) void {
contents.explicit_types.deinit(gpa);
contents.other.deinit(gpa);
}
}