The position of a ZIR instruction within the Zir instructions array.
main_struct_inst = 0ZIR is structured so that the outermost "main" struct of any file is always at index 0.
ref_start_index = static_len_pub const static_len = 93i: Indexpub fn toRef(i: Index) Inst.Ref {
return @enumFromInt(@intFromEnum(Index.ref_start_index) + @intFromEnum(i));
}pub fn toOptional(i: Index) OptionalIndexi: Indexpub fn toOptional(i: Index) OptionalIndex {
return @enumFromInt(@intFromEnum(i));
}pub const Index = enum(u32) {
/// ZIR is structured so that the outermost "main" struct of any file
/// is always at index 0.
main_struct_inst = 0,
ref_start_index = static_len,
_,
pub const static_len = 93;
pub fn toRef(i: Index) Inst.Ref {
return @enumFromInt(@intFromEnum(Index.ref_start_index) + @intFromEnum(i));
}
pub fn toOptional(i: Index) OptionalIndex {
return @enumFromInt(@intFromEnum(i));
}
}