Skip to main content

RegionBranchTerminatorOpInterface

Trait RegionBranchTerminatorOpInterface 

Source
pub trait RegionBranchTerminatorOpInterface: Op {
    // Required method
    fn successor_operands(
        &self,
        ctx: &Context,
        successor: RegionSuccessor,
    ) -> Vec<Use<Value>>;

    // Provided methods
    fn verify(_op: &dyn Op, _ctx: &Context) -> Result<()>
       where Self: Sized { ... }
    fn successor_regions(
        &self,
        ctx: &Context,
        operands: &[Option<AttrObj>],
    ) -> Vec<RegionSuccessor> { ... }
}
Expand description

This interface provides information for branching terminator operations in the presence of a parent RegionBranchOpInterface implementation. It acts as a marker for valid region branch points and specifies which operands are passed to which region successor.

Note: If an operation does not implement the RegionBranchTerminatorOpInterface, then that op has no region successors. (However, there may be other block terminators in the same region that implement the RegionBranchTerminatorOpInterface, so the enclosing region may have region successors.)

Required Methods§

Source

fn successor_operands( &self, ctx: &Context, successor: RegionSuccessor, ) -> Vec<Use<Value>>

Returns a range of operands that are semantically “returned” by passing them to the region successor.

Provided Methods§

Source

fn verify(_op: &dyn Op, _ctx: &Context) -> Result<()>
where Self: Sized,

Source

fn successor_regions( &self, ctx: &Context, operands: &[Option<AttrObj>], ) -> Vec<RegionSuccessor>

Returns all potential region successors that are branched to after this terminator based on the given constant operands.

This method also receives the constant operands of this op (one entry per operand, None if the operand has no/unknown constant value). The implementation may use this information to filter out successors. By default, it simply dispatches to the parent RegionBranchOpInterface’s successor_regions implementation.

Trait Implementations§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§