Skip to main content

StmtKind

Enum StmtKind 

Source
pub enum StmtKind<'a, E: ExprNode> {
    Assignment {
        lhs: Ident,
        size: Option<usize>,
        rhs: E,
    },
    LoadAssignment {
        load: LoadNode<'a, E>,
        size: Option<usize>,
        rhs: E,
    },
    RangeAssignment {
        range: RangeNode<E>,
        size: Option<usize>,
        rhs: E,
    },
    Label(Cow<'a, str>),
    Branch {
        target: TargetNode<'a, E>,
    },
    ConditionalBranch {
        condition: E,
        target: TargetNode<'a, E>,
    },
    BranchIndirect {
        target: E,
    },
    Call {
        target: TargetNode<'a, E>,
    },
    CallIndirect {
        target: E,
    },
    Return {
        target: E,
    },
    Expression(E),
    Internal(&'static str),
}
Expand description

The shape of one statement. See AstNode for the meaning of each variant.

Variants§

§

Assignment

lhs = rhs.

Fields

§lhs: Ident

The storage written.

§size: Option<usize>

The width written, if any.

§rhs: E

The value.

§

LoadAssignment

*[space]:size ptr = rhs.

Fields

§load: LoadNode<'a, E>

Where the value goes.

§size: Option<usize>

The width written, if any.

§rhs: E

The value.

§

RangeAssignment

value[start, size] = rhs.

Fields

§range: RangeNode<E>

The bits written.

§size: Option<usize>

The width written, if any.

§rhs: E

The value.

§

Label(Cow<'a, str>)

<name>.

§

Branch

goto target.

Fields

§target: TargetNode<'a, E>

Where.

§

ConditionalBranch

if condition goto target.

Fields

§condition: E

The one-byte condition.

§target: TargetNode<'a, E>

Where.

§

BranchIndirect

goto [target].

Fields

§target: E

The address.

§

Call

call target.

Fields

§target: TargetNode<'a, E>

Where.

§

CallIndirect

call [target].

Fields

§target: E

The address.

§

Return

return [target].

Fields

§target: E

The address.

§

Expression(E)

An expression evaluated for its effect.

§

Internal(&'static str)

A statement that has no place in a consumer-form AST: build, delayslot, export, or a deferred build. The passes reject it with PcodeLowerError::InternalNode.

Trait Implementations§

Source§

impl<'a, E: Clone + ExprNode> Clone for StmtKind<'a, E>

Source§

fn clone(&self) -> StmtKind<'a, E>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, E: Debug + ExprNode> Debug for StmtKind<'a, E>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, S> From<&'a AstNode<S>> for StmtKind<'a, &'a Expression<S>>

Source§

fn from(statement: &'a AstNode<S>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a, E> Freeze for StmtKind<'a, E>
where E: Freeze, LoadNode<'a, E>: Freeze, RangeNode<E>: Freeze, TargetNode<'a, E>: Freeze,

§

impl<'a, E> RefUnwindSafe for StmtKind<'a, E>

§

impl<'a, E> Send for StmtKind<'a, E>
where E: Send, LoadNode<'a, E>: Send, RangeNode<E>: Send, TargetNode<'a, E>: Send,

§

impl<'a, E> Sync for StmtKind<'a, E>
where E: Sync, LoadNode<'a, E>: Sync, RangeNode<E>: Sync, TargetNode<'a, E>: Sync,

§

impl<'a, E> Unpin for StmtKind<'a, E>
where E: Unpin, LoadNode<'a, E>: Unpin, RangeNode<E>: Unpin, TargetNode<'a, E>: Unpin,

§

impl<'a, E> UnsafeUnpin for StmtKind<'a, E>

§

impl<'a, E> UnwindSafe for StmtKind<'a, E>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.