[][src]Struct souper_ir::ast::ReplacementBuilder

pub struct ReplacementBuilder { /* fields omitted */ }

A builder for a Replacement.

Implementations

impl ReplacementBuilder[src]

pub fn assignment(
    &mut self,
    name: Option<String>,
    r#type: Option<Type>,
    value: impl Into<AssignmentRhs>,
    attributes: Vec<Attribute>
) -> ValueId
[src]

Create a new assignment statement.

Returns the value defined by the assignment.

Panics

Panics if name (when given) does not start with '%'.

pub fn block(&mut self, name: Option<String>, predecessors: u32) -> BlockId[src]

Create a new basic block.

Declare that the block has predecessors number of incoming edges in the control-flow graph.

Panics

Panics if name (when given) does not start with '%'.

pub fn pc(&mut self, x: impl Into<Operand>, y: impl Into<Operand>)[src]

Create a path condition.

Expresses the fact that x must equal y for the replacement to be valid.

pub fn block_pc(
    &mut self,
    block: BlockId,
    predecessor: u32,
    x: impl Into<Operand>,
    y: impl Into<Operand>
)
[src]

Create a block path condition.

Expresses that x is equal to y on an incoming edge to block in the control-flow graph.

Panics

Panics if predecessor is greater than or equal to block's number of predecessors.

pub fn finish(
    self,
    lhs: ValueId,
    rhs: impl Into<Operand>,
    attributes: impl IntoIterator<Item = RootAttribute>
) -> Replacement
[src]

Finish building this replacement by providing the left- and right-hand sides.

Trait Implementations

impl Clone for ReplacementBuilder[src]

impl Debug for ReplacementBuilder[src]

impl Default for ReplacementBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.