const Index = enum(u32) pub fn ptr(self: Index, wip: *WipFunction) *Blockpub fn ptrConst(self: Index, wip: *const WipFunction) *const Blockpub fn toInst(self: Index, function: *const Function) Instruction.Index6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378 const Index = enum(u32) {
entry,
_,
pub fn ptr(self: Index, wip: *WipFunction) *Block {
return &wip.blocks.items[@backingInt(self)];
}
pub fn ptrConst(self: Index, wip: *const WipFunction) *const Block {
return &wip.blocks.items[@backingInt(self)];
}
pub fn toInst(self: Index, function: *const Function) Instruction.Index {
return function.blocks[@backingInt(self)].instruction;
}
}