pub const Index = enum(u32) pub fn toRef(i: Index) Inst.Refpub fn toOptional(i: Index) OptionalIndex2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211 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,
_,
pub fn toRef(i: Index) Inst.Ref {
return @fromBackingInt(@intCast(Ref.static_len + @backingInt(i)));
}
pub fn toOptional(i: Index) OptionalIndex {
return @fromBackingInt(@intCast(@backingInt(i)));
}
}
The position of a ZIR instruction within the
Zirinstructions array.