[][src]Struct cranelift_frontend::Switch

pub struct Switch { /* fields omitted */ }

Unlike with br_table, Switch cases may be sparse or non-0-based. They emit efficient code using branches, jump tables, or a combination of both.

Methods

impl Switch
[src]

pub fn new() -> Self
[src]

Create a new empty switch

pub fn set_entry(&mut self, index: u64, ebb: Ebb)
[src]

Set a switch entry

pub fn emit(self, bx: &mut FunctionBuilder, val: Value, otherwise: Ebb)
[src]

Build the switch

Arguments

  • The function builder to emit to
  • The value to switch on
  • The default ebb

Trait Implementations

impl Debug for Switch
[src]

impl Default for Switch
[src]

Auto Trait Implementations

impl Send for Switch

impl Sync for Switch

Blanket Implementations

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> From for T
[src]

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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