Struct test_generation::control_flow_graph::CFG
source · pub struct CFG { /* private fields */ }
Expand description
A control flow graph
Implementations§
source§impl CFG
impl CFG
sourcepub fn new(
rng: &mut StdRng,
locals: &[SignatureToken],
parameters: &Signature,
target_blocks: u16
) -> CFG
pub fn new( rng: &mut StdRng, locals: &[SignatureToken], parameters: &Signature, target_blocks: u16 ) -> CFG
Construct a control flow graph that contains empty basic blocks with set incoming and outgoing locals. Currently the control flow graph is acyclic.
sourcepub fn get_basic_blocks(&self) -> &HashMap<u16, BasicBlock>
pub fn get_basic_blocks(&self) -> &HashMap<u16, BasicBlock>
Get a reference to all of the basic blocks of the CFG
sourcepub fn get_basic_blocks_mut(&mut self) -> &mut HashMap<u16, BasicBlock>
pub fn get_basic_blocks_mut(&mut self) -> &mut HashMap<u16, BasicBlock>
Get a mutable reference to all of the basic blocks of the CFG
sourcepub fn get_children_ids(&self, block_id: u16) -> Vec<u16> ⓘ
pub fn get_children_ids(&self, block_id: u16) -> Vec<u16> ⓘ
Retrieve the block IDs of all children of the given basic block block_id
sourcepub fn num_children(&self, block_id: u16) -> u8
pub fn num_children(&self, block_id: u16) -> u8
Retrieve the number of children the given basic block block_id
sourcepub fn get_parent_ids(&self, block_id: u16) -> Vec<u16> ⓘ
pub fn get_parent_ids(&self, block_id: u16) -> Vec<u16> ⓘ
Retrieve the block IDs of all parents of the given basic block block_id
sourcepub fn num_parents(&self, block_id: u16) -> u8
pub fn num_parents(&self, block_id: u16) -> u8
Retrieve the number of parents the given basic block block_id
sourcepub fn serialize_block_order(&self) -> Vec<u16> ⓘ
pub fn serialize_block_order(&self) -> Vec<u16> ⓘ
Decide the serialization order of the blocks in the CFG