pub struct FlowGraph {
pub nodes: FlowNodeArena,
pub node_flow: FxHashMap<u32, FlowNodeId>,
pub unreachable_flow: FlowNodeId,
pub unreachable_nodes: FxHashSet<u32>,
}Expand description
A control flow graph side-table.
This struct encapsulates the flow graph data structures, providing a clean abstraction for querying flow information without holding a reference to the entire binder state.
Fields§
§nodes: FlowNodeArenaArena storing all flow nodes
node_flow: FxHashMap<u32, FlowNodeId>Mapping from AST node index to the flow node active at that point
unreachable_flow: FlowNodeIdUnreachable flow node (for never-returning code paths)
unreachable_nodes: FxHashSet<u32>Set of AST node indices that are unreachable
Implementations§
Source§impl FlowGraph
impl FlowGraph
Sourcepub fn get_flow_at_node(&self, node: NodeIndex) -> Option<FlowNodeId>
pub fn get_flow_at_node(&self, node: NodeIndex) -> Option<FlowNodeId>
Get the flow node at a given AST node position.
Sourcepub fn get_node(&self, id: FlowNodeId) -> Option<&FlowNode>
pub fn get_node(&self, id: FlowNodeId) -> Option<&FlowNode>
Get a flow node by ID.
Sourcepub fn has_flow_at_node(&self, node: NodeIndex) -> bool
pub fn has_flow_at_node(&self, node: NodeIndex) -> bool
Check if a flow node exists.
Sourcepub fn is_unreachable(&self, node: NodeIndex) -> bool
pub fn is_unreachable(&self, node: NodeIndex) -> bool
Check if an AST node is unreachable.
Sourcepub fn mark_unreachable(&mut self, node: NodeIndex)
pub fn mark_unreachable(&mut self, node: NodeIndex)
Mark an AST node as unreachable.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FlowGraph
impl RefUnwindSafe for FlowGraph
impl Send for FlowGraph
impl Sync for FlowGraph
impl Unpin for FlowGraph
impl UnsafeUnpin for FlowGraph
impl UnwindSafe for FlowGraph
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