Struct rune_ssa::Block [−][src]
A block containing a sequence of assignments.
A block carries a definition of its entry. The entry is the sequence of input variables the block expects.
Implementations
impl Block
[src]
pub fn name(&self) -> Option<&str>
[src]
The name of the block.
pub fn read(&self, var: Var) -> Result<Assign, Error>
[src]
Read the given variable, looking it up recursively in ancestor blocks and memoizing as needed.
pub fn assign(&self, var: Var, to_read: Var) -> Result<(), Error>
[src]
Assign a variable.
pub fn input(&self) -> Result<Var, Error>
[src]
Define an input into the block.
pub fn id(&self) -> BlockId
[src]
Get the identifier of the block.
pub fn dump(&self) -> BlockDump<'_>
[src]
Perform a diagnostical dump of a block.
pub fn unit(&self) -> Result<Var, Error>
[src]
Define a unit.
pub fn assign_unit(&self, id: Var) -> Result<(), Error>
[src]
Assign a unit.
pub fn constant(&self, constant: Constant) -> Result<Var, Error>
[src]
Define a constant.
pub fn assign_constant(&self, id: Var, constant: Constant) -> Result<(), Error>
[src]
Assign a constant.
pub fn not(&self, a: Var) -> Result<Var, Error>
[src]
Compute !arg
.
pub fn assign_not(&self, id: Var, a: Var) -> Result<(), Error>
[src]
Compute !arg
.
pub fn add(&self, a: Var, b: Var) -> Result<Var, Error>
[src]
Compute lhs + rhs
.
pub fn assign_add(&self, id: Var, a: Var, b: Var) -> Result<(), Error>
[src]
Compute lhs + rhs
.
pub fn sub(&self, a: Var, b: Var) -> Result<Var, Error>
[src]
Compute lhs - rhs
.
pub fn assign_sub(&self, id: Var, a: Var, b: Var) -> Result<(), Error>
[src]
Compute lhs - rhs
.
pub fn div(&self, a: Var, b: Var) -> Result<Var, Error>
[src]
Compute lhs / rhs
.
pub fn assign_div(&self, id: Var, a: Var, b: Var) -> Result<(), Error>
[src]
Compute lhs / rhs
.
pub fn mul(&self, a: Var, b: Var) -> Result<Var, Error>
[src]
Compute lhs * rhs
.
pub fn assign_mul(&self, id: Var, a: Var, b: Var) -> Result<(), Error>
[src]
Compute lhs * rhs
.
pub fn cmp_lt(&self, a: Var, b: Var) -> Result<Var, Error>
[src]
Compare if lhs < rhs
.
pub fn assign_cmp_lt(&self, id: Var, a: Var, b: Var) -> Result<(), Error>
[src]
Compare if lhs < rhs
.
pub fn cmp_lte(&self, a: Var, b: Var) -> Result<Var, Error>
[src]
Compare if lhs <= rhs
.
pub fn assign_cmp_lte(&self, id: Var, a: Var, b: Var) -> Result<(), Error>
[src]
Compare if lhs <= rhs
.
pub fn cmp_eq(&self, a: Var, b: Var) -> Result<Var, Error>
[src]
Compare if lhs == rhs
.
pub fn assign_cmp_eq(&self, id: Var, a: Var, b: Var) -> Result<(), Error>
[src]
Compare if lhs == rhs
.
pub fn cmp_gt(&self, a: Var, b: Var) -> Result<Var, Error>
[src]
Compare if lhs > rhs
.
pub fn assign_cmp_gt(&self, id: Var, a: Var, b: Var) -> Result<(), Error>
[src]
Compare if lhs > rhs
.
pub fn cmp_gte(&self, a: Var, b: Var) -> Result<Var, Error>
[src]
Compare if lhs >= rhs
.
pub fn assign_cmp_gte(&self, id: Var, a: Var, b: Var) -> Result<(), Error>
[src]
Compare if lhs >= rhs
.
pub fn jump(&self, block: &Block) -> Result<(), Error>
[src]
Perform an unconditional jump to the given block with the specified inputs.
pub fn jump_if(
&self,
condition: Var,
then_block: &Block,
else_block: &Block
) -> Result<(), Error>
[src]
&self,
condition: Var,
then_block: &Block,
else_block: &Block
) -> Result<(), Error>
Perform a conditional jump to the given block with the specified inputs if the given condition is true.
pub fn return_unit(&self) -> Result<(), Error>
[src]
Return from this the procedure this block belongs to.
pub fn return_(&self, var: Var) -> Result<(), Error>
[src]
Return from this the procedure this block belongs to.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Block
impl !Send for Block
impl !Sync for Block
impl Unpin for Block
impl !UnwindSafe for Block
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,