enum Index [src]
The position of a ZIR instruction within the Zir instructions array.
Fields
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
_
Members
- static_len (Constant)
- toOptional (Function)
- toRef (Function)
Source
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 = 97;
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));
}
}