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§
sourcefn num_operands(&self) -> usize
fn num_operands(&self) -> usize
Get the number of operands.
This is also the number of uses of the operation.
sourcefn num_results(&self) -> usize
fn num_results(&self) -> usize
Get the number of results.
This is also the number of definitions of the operation.
sourcefn get_operand(&self, index: usize) -> Option<ArenaPtr<Value>>
fn get_operand(&self, index: usize) -> Option<ArenaPtr<Value>>
Get the operand at the given index.
sourcefn get_result(&self, index: usize) -> Option<ArenaPtr<Value>>
fn get_result(&self, index: usize) -> Option<ArenaPtr<Value>>
Get the result at the given index.