Trait orzir_core::RegionInterface

source ·
pub trait RegionInterface {
    // Required methods
    fn num_regions(&self) -> usize;
    fn get_region(&self, index: usize) -> Option<ArenaPtr<Region>>;
    fn set_region(
        &mut self,
        index: usize,
        region: ArenaPtr<Region>
    ) -> Option<ArenaPtr<Region>>;

    // Provided methods
    fn regions(&self) -> Vec<ArenaPtr<Region>> { ... }
    fn get_region_kind(&self, ctx: &Context, index: usize) -> RegionKind { ... }
    fn has_ssa_dominance(&self, ctx: &Context, index: usize) -> bool { ... }
}
Expand description

Builtin region interface.

This trait provides methods to interact with regions. This is set to be a mandatory interface for all operations for performance reasons.

Required Methods§

source

fn num_regions(&self) -> usize

Get the number of regions.

source

fn get_region(&self, index: usize) -> Option<ArenaPtr<Region>>

Get the region at the given index.

source

fn set_region( &mut self, index: usize, region: ArenaPtr<Region> ) -> Option<ArenaPtr<Region>>

Set the region at the given index and return the old region (if any).

Provided Methods§

source

fn regions(&self) -> Vec<ArenaPtr<Region>>

Get all regions.

source

fn get_region_kind(&self, ctx: &Context, index: usize) -> RegionKind

Get the region kind at the given index.

source

fn has_ssa_dominance(&self, ctx: &Context, index: usize) -> bool

Check if the region has SSA dominance.

Implementors§