pub trait ControlFlowGraph {
    // Required methods
    fn block_start(&self, block_id: BlockId) -> CodeOffset;
    fn block_end(&self, block_id: BlockId) -> CodeOffset;
    fn successors(&self, block_id: BlockId) -> &Vec<BlockId> ;
    fn instr_indexes(
        &self,
        block_id: BlockId
    ) -> Box<dyn Iterator<Item = CodeOffset>>;
    fn blocks(&self) -> Vec<BlockId> ;
    fn num_blocks(&self) -> u16;
    fn entry_block_id(&self) -> BlockId;
}
Expand description

A trait that specifies the basic requirements for a CFG

Required Methods§

source

fn block_start(&self, block_id: BlockId) -> CodeOffset

Start index of the block ID in the bytecode vector

source

fn block_end(&self, block_id: BlockId) -> CodeOffset

End index of the block ID in the bytecode vector

source

fn successors(&self, block_id: BlockId) -> &Vec<BlockId>

Successors of the block ID in the bytecode vector

source

fn instr_indexes( &self, block_id: BlockId ) -> Box<dyn Iterator<Item = CodeOffset>>

Iterator over the indexes of instructions in this block

source

fn blocks(&self) -> Vec<BlockId>

Return an iterator over the blocks of the CFG

source

fn num_blocks(&self) -> u16

Return the number of blocks (vertices) in the control flow graph

source

fn entry_block_id(&self) -> BlockId

Return the id of the entry block for this control-flow graph Note: even a CFG with no instructions has an (empty) entry block.

Implementors§