Enum cranelift_isle::serialize::ControlFlow

source ·
pub enum ControlFlow {
    Match {
        source: BindingId,
        arms: Vec<MatchArm>,
    },
    Equal {
        a: BindingId,
        b: BindingId,
        body: Block,
    },
    Loop {
        result: BindingId,
        body: Block,
    },
    Return {
        pos: Pos,
        result: BindingId,
    },
}
Expand description

What kind of control-flow structure do we need to emit here?

Variants§

§

Match

Test a binding site against one or more mutually-exclusive patterns and branch to the appropriate block if a pattern matches.

Fields

§source: BindingId

Which binding site are we examining at this point?

§arms: Vec<MatchArm>

What patterns do we care about?

§

Equal

Test whether two binding sites have values which are equal when evaluated on the current input.

Fields

§a: BindingId

One binding site.

§b: BindingId

The other binding site. To ensure we always generate the same code given the same set of ISLE rules, b should be strictly greater than a.

§body: Block

If the test succeeds, evaluate this block.

§

Loop

Evaluate a block once with each value of the given binding site.

Fields

§result: BindingId

A binding site of type Binding::Iterator. Its source binding site must be a multi-extractor or multi-constructor call.

§body: Block

What to evaluate with each binding.

§

Return

Return a result from the right-hand side of a rule. If we’re building a multi-constructor then this doesn’t actually return, but adds to a list of results instead. Otherwise this return stops evaluation before any later steps.

Fields

§pos: Pos

Where was the rule defined that had this right-hand side?

§result: BindingId

What is the result expression which should be returned if this rule matched?

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.