struct Block [src]

Fields

name: String
incoming: u32
branches: u32 = 0
instructions: std.ArrayListUnmanaged(Instruction.Index)

Source

pub const Block = struct { name: String, incoming: u32, branches: u32 = 0, instructions: std.ArrayListUnmanaged(Instruction.Index), const Index = enum(u32) { entry, _, pub fn ptr(self: Index, wip: *WipFunction) *Block { return &wip.blocks.items[@intFromEnum(self)]; } pub fn ptrConst(self: Index, wip: *const WipFunction) *const Block { return &wip.blocks.items[@intFromEnum(self)]; } pub fn toInst(self: Index, function: *const Function) Instruction.Index { return function.blocks[@intFromEnum(self)].instruction; } }; }