pub struct Region { /* private fields */ }
Expand description
Represents a region in the control-flow graph.
Implementations§
Source§impl Region
impl Region
Sourcepub fn new(region_type: RegionType, region_id: RegionId) -> Self
pub fn new(region_type: RegionType, region_id: RegionId) -> Self
Creates a new region with the specified type and initializes with no statements.
§Arguments
id
- The id of the region.
Sourcepub fn region_type(&self) -> &RegionType
pub fn region_type(&self) -> &RegionType
Returns the type of the region.
Sourcepub fn push_unresolved_node(&mut self, node: AstKind)
pub fn push_unresolved_node(&mut self, node: AstKind)
Sourcepub fn push_nodes(&mut self, nodes: Vec<AstKind>)
pub fn push_nodes(&mut self, nodes: Vec<AstKind>)
Sourcepub fn push_unresolved_nodes(&mut self, nodes: Vec<AstKind>)
pub fn push_unresolved_nodes(&mut self, nodes: Vec<AstKind>)
Sourcepub fn clear_nodes(&mut self)
pub fn clear_nodes(&mut self)
Clears the nodes in the region
Sourcepub fn clear_unresolved_nodes(&mut self)
pub fn clear_unresolved_nodes(&mut self)
Clears the unresolved nodes in the region
Sourcepub fn get_unresolved_nodes(&self) -> &Vec<AstKind>
pub fn get_unresolved_nodes(&self) -> &Vec<AstKind>
Sourcepub fn get_region_type(&self) -> RegionType
pub fn get_region_type(&self) -> RegionType
Sourcepub fn set_region_type(&mut self, region_type: RegionType)
pub fn set_region_type(&mut self, region_type: RegionType)
Sourcepub fn remove_jump_expr(&mut self)
pub fn remove_jump_expr(&mut self)
Remove the jump expression from the region.
Sourcepub fn get_jump_expr(&self) -> Option<&ExprKind>
pub fn get_jump_expr(&self) -> Option<&ExprKind>
Sourcepub fn set_jump_expr(&mut self, jump_expr: Option<ExprKind>)
pub fn set_jump_expr(&mut self, jump_expr: Option<ExprKind>)
Sourcepub fn get_branch_opcode(&self) -> Option<Opcode>
pub fn get_branch_opcode(&self) -> Option<Opcode>
Sourcepub fn set_branch_opcode(&mut self, opcode: Opcode)
pub fn set_branch_opcode(&mut self, opcode: Opcode)
Sourcepub fn iter_nodes(&self) -> Iter<'_, AstKind>
pub fn iter_nodes(&self) -> Iter<'_, AstKind>
Returns an iterator over the statements in the region.
§Return
An iterator over the statements in the region.
Trait Implementations§
Source§impl<'a> IntoIterator for &'a Region
Allows iterating over the statements in a region.
impl<'a> IntoIterator for &'a Region
Allows iterating over the statements in a region.
Source§impl<'a> IntoIterator for &'a mut Region
Allows iterating over the statements in a region (mutable).
impl<'a> IntoIterator for &'a mut Region
Allows iterating over the statements in a region (mutable).
Auto Trait Implementations§
impl Freeze for Region
impl RefUnwindSafe for Region
impl Send for Region
impl Sync for Region
impl Unpin for Region
impl UnwindSafe for Region
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