Struct quil_rs::program::analysis::ControlFlowGraph
source · pub struct ControlFlowGraph<'p> { /* private fields */ }
Expand description
A control flow graph (CFG) is a representation of a program’s control flow as a directed graph. Each node in the graph is a basic block, a sequence of instructions with a single entry point and a single exit point. The edges in the graph represent control flow between basic blocks.
Implementations§
source§impl<'p> ControlFlowGraph<'p>
impl<'p> ControlFlowGraph<'p>
sourcepub fn has_dynamic_control_flow(&self) -> bool
pub fn has_dynamic_control_flow(&self) -> bool
Returns true
if the program contains dynamic control flow, i.e. JUMP-WHEN
or JUMP-UNLESS
sourcepub fn into_blocks(self) -> Vec<BasicBlock<'p>>
pub fn into_blocks(self) -> Vec<BasicBlock<'p>>
Returns the basic blocks in the control flow graph.
Trait Implementations§
source§impl<'p> Clone for ControlFlowGraph<'p>
impl<'p> Clone for ControlFlowGraph<'p>
source§fn clone(&self) -> ControlFlowGraph<'p>
fn clone(&self) -> ControlFlowGraph<'p>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'p> Debug for ControlFlowGraph<'p>
impl<'p> Debug for ControlFlowGraph<'p>
source§impl<'p> Default for ControlFlowGraph<'p>
impl<'p> Default for ControlFlowGraph<'p>
source§fn default() -> ControlFlowGraph<'p>
fn default() -> ControlFlowGraph<'p>
Returns the “default value” for a type. Read more
source§impl<'p> From<&'p ControlFlowGraphOwned> for ControlFlowGraph<'p>
impl<'p> From<&'p ControlFlowGraphOwned> for ControlFlowGraph<'p>
source§fn from(value: &'p ControlFlowGraphOwned) -> Self
fn from(value: &'p ControlFlowGraphOwned) -> Self
Converts to this type from the input type.
source§impl<'p> From<&'p Program> for ControlFlowGraph<'p>
impl<'p> From<&'p Program> for ControlFlowGraph<'p>
source§impl From<ControlFlowGraph<'_>> for ControlFlowGraphOwned
impl From<ControlFlowGraph<'_>> for ControlFlowGraphOwned
source§fn from(value: ControlFlowGraph<'_>) -> Self
fn from(value: ControlFlowGraph<'_>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'p> RefUnwindSafe for ControlFlowGraph<'p>
impl<'p> Send for ControlFlowGraph<'p>
impl<'p> Sync for ControlFlowGraph<'p>
impl<'p> Unpin for ControlFlowGraph<'p>
impl<'p> UnwindSafe for ControlFlowGraph<'p>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more