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.
pub const DeclContents = struct
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);
}
}