Trait orzir_core::DataFlow

source ·
pub trait DataFlow {
    // Required methods
    fn num_operands(&self) -> usize;
    fn num_results(&self) -> usize;
    fn get_operand(&self, index: usize) -> Option<ArenaPtr<Value>>;
    fn get_result(&self, index: usize) -> Option<ArenaPtr<Value>>;
    fn set_operand(
        &mut self,
        index: usize,
        operand: ArenaPtr<Value>
    ) -> Option<ArenaPtr<Value>>;
    fn set_result(
        &mut self,
        index: usize,
        result: ArenaPtr<Value>
    ) -> Option<ArenaPtr<Value>>;

    // Provided methods
    fn operands(&self) -> Vec<ArenaPtr<Value>> { ... }
    fn results(&self) -> Vec<ArenaPtr<Value>> { ... }
    fn operand_tys(&self, ctx: &Context) -> Vec<ArenaPtr<TyObj>> { ... }
    fn result_tys(&self, ctx: &Context) -> Vec<ArenaPtr<TyObj>> { ... }
}
Expand description

Builtin value interface.

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

Required Methods§

source

fn num_operands(&self) -> usize

Get the number of operands.

This is also the number of uses of the operation.

source

fn num_results(&self) -> usize

Get the number of results.

This is also the number of definitions of the operation.

source

fn get_operand(&self, index: usize) -> Option<ArenaPtr<Value>>

Get the operand at the given index.

source

fn get_result(&self, index: usize) -> Option<ArenaPtr<Value>>

Get the result at the given index.

source

fn set_operand( &mut self, index: usize, operand: ArenaPtr<Value> ) -> Option<ArenaPtr<Value>>

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

source

fn set_result( &mut self, index: usize, result: ArenaPtr<Value> ) -> Option<ArenaPtr<Value>>

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

Provided Methods§

source

fn operands(&self) -> Vec<ArenaPtr<Value>>

Get all operands.

source

fn results(&self) -> Vec<ArenaPtr<Value>>

Get all results.

source

fn operand_tys(&self, ctx: &Context) -> Vec<ArenaPtr<TyObj>>

Get all operand types.

source

fn result_tys(&self, ctx: &Context) -> Vec<ArenaPtr<TyObj>>

Get all result types.

Implementors§