pub enum RawStatement {
Assign(Place, Rvalue),
Call(Call),
FakeRead(Place),
SetDiscriminant(Place, VariantId),
StorageDead(VarId),
Deinit(Place),
Drop(Place),
Assert(Assert),
Nop,
Error(String),
}
Expand description
A raw statement: a statement without meta data.
Variants§
Assign(Place, Rvalue)
Call(Call)
A call. For now, we don’t support dynamic calls (i.e. to a function pointer in memory).
FakeRead(Place)
SetDiscriminant(Place, VariantId)
StorageDead(VarId)
We translate this to crate::llbc_ast::RawStatement::Drop in LLBC
Deinit(Place)
We translate this to crate::llbc_ast::RawStatement::Drop in LLBC
Drop(Place)
Assert(Assert)
A built-in assert, which corresponds to runtime checks that we remove, namely: bounds checks, over/underflow checks, div/rem by zero checks, pointer alignement check.
Nop
Does nothing. Useful for passes.
Error(String)
Implementations§
source§impl RawStatement
impl RawStatement
pub fn is_assign(&self) -> bool
pub fn is_call(&self) -> bool
pub fn is_fake_read(&self) -> bool
pub fn is_set_discriminant(&self) -> bool
pub fn is_storage_dead(&self) -> bool
pub fn is_deinit(&self) -> bool
pub fn is_drop(&self) -> bool
pub fn is_assert(&self) -> bool
pub fn is_nop(&self) -> bool
pub fn is_error(&self) -> bool
source§impl RawStatement
impl RawStatement
pub fn as_assign(&self) -> Option<(&Place, &Rvalue)>
pub fn as_call(&self) -> Option<&Call>
pub fn as_fake_read(&self) -> Option<&Place>
pub fn as_set_discriminant(&self) -> Option<(&Place, &VariantId)>
pub fn as_storage_dead(&self) -> Option<&VarId>
pub fn as_deinit(&self) -> Option<&Place>
pub fn as_drop(&self) -> Option<&Place>
pub fn as_assert(&self) -> Option<&Assert>
pub fn as_nop(&self) -> Option<()>
pub fn as_error(&self) -> Option<&String>
source§impl RawStatement
impl RawStatement
pub fn as_assign_mut(&mut self) -> Option<(&mut Place, &mut Rvalue)>
pub fn as_call_mut(&mut self) -> Option<&mut Call>
pub fn as_fake_read_mut(&mut self) -> Option<&mut Place>
pub fn as_set_discriminant_mut( &mut self, ) -> Option<(&mut Place, &mut VariantId)>
pub fn as_storage_dead_mut(&mut self) -> Option<&mut VarId>
pub fn as_deinit_mut(&mut self) -> Option<&mut Place>
pub fn as_drop_mut(&mut self) -> Option<&mut Place>
pub fn as_assert_mut(&mut self) -> Option<&mut Assert>
pub fn as_nop_mut(&mut self) -> Option<()>
pub fn as_error_mut(&mut self) -> Option<&mut String>
source§impl RawStatement
impl RawStatement
pub fn variant_name(&self) -> &'static str
Trait Implementations§
source§impl Clone for RawStatement
impl Clone for RawStatement
source§fn clone(&self) -> RawStatement
fn clone(&self) -> RawStatement
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for RawStatement
impl Debug for RawStatement
source§impl<'de> Deserialize<'de> for RawStatement
impl<'de> Deserialize<'de> for RawStatement
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RawStatement
impl RefUnwindSafe for RawStatement
impl Send for RawStatement
impl Sync for RawStatement
impl Unpin for RawStatement
impl UnwindSafe for RawStatement
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
Given the context attached to a nom error, and given the original
input to the nom parser, extract more the useful context information. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<I> RecreateContext<I> for I
impl<I> RecreateContext<I> for I
§fn recreate_context(_original_input: I, tail: I) -> I
fn recreate_context(_original_input: I, tail: I) -> I
Given the original input, as well as the context reported by nom,
recreate a context in the original string where the error occurred. Read more