[−][src]Enum falcon::il::Expression
An IL Expression.
Variants
Scalar(Scalar)
Constant(Constant)
Add(Box<Expression>, Box<Expression>)
Sub(Box<Expression>, Box<Expression>)
Mul(Box<Expression>, Box<Expression>)
Divu(Box<Expression>, Box<Expression>)
Modu(Box<Expression>, Box<Expression>)
Divs(Box<Expression>, Box<Expression>)
Mods(Box<Expression>, Box<Expression>)
And(Box<Expression>, Box<Expression>)
Or(Box<Expression>, Box<Expression>)
Xor(Box<Expression>, Box<Expression>)
Shl(Box<Expression>, Box<Expression>)
Shr(Box<Expression>, Box<Expression>)
Cmpeq(Box<Expression>, Box<Expression>)
Cmpneq(Box<Expression>, Box<Expression>)
Cmplts(Box<Expression>, Box<Expression>)
Cmpltu(Box<Expression>, Box<Expression>)
Zext(usize, Box<Expression>)
Sext(usize, Box<Expression>)
Trun(usize, Box<Expression>)
Ite(Box<Expression>, Box<Expression>, Box<Expression>)
Methods
impl Expression
[src]
pub fn bits(&self) -> usize
[src]
Return the bitness of this expression.
pub fn replace_scalar(
&self,
scalar: &Scalar,
expression: &Expression
) -> Result<Expression>
[src]
&self,
scalar: &Scalar,
expression: &Expression
) -> Result<Expression>
Return a clone of this expression, but with every occurrence of the given scalar replaced with the given expression
pub fn all_constants(&self) -> bool
[src]
Return true if all terminals in this expression are Constant
pub fn scalars(&self) -> Vec<&Scalar>
[src]
Returns all Scalars
used in this Expression
pub fn scalars_mut(&mut self) -> Vec<&mut Scalar>
[src]
Return mutable references to all Scalars
in this Expression
.
pub fn get_scalar(&self) -> Option<&Scalar>
[src]
If this expression is a scalar, return the scalar
pub fn get_constant(&self) -> Option<&Constant>
[src]
If this expression is a constant, return the constant
pub fn scalar(scalar: Scalar) -> Expression
[src]
Create a new Expression
from a Scalar
.
pub fn constant(constant: Constant) -> Expression
[src]
Create a new Expression
from a Constant
.
pub fn add(lhs: Expression, rhs: Expression) -> Result<Expression>
[src]
pub fn sub(lhs: Expression, rhs: Expression) -> Result<Expression>
[src]
pub fn mul(lhs: Expression, rhs: Expression) -> Result<Expression>
[src]
Create an unsigned multiplication Expression
.
Error
The sort of the lhs and the rhs are not the same.
pub fn divu(lhs: Expression, rhs: Expression) -> Result<Expression>
[src]
pub fn modu(lhs: Expression, rhs: Expression) -> Result<Expression>
[src]
pub fn divs(lhs: Expression, rhs: Expression) -> Result<Expression>
[src]
pub fn mods(lhs: Expression, rhs: Expression) -> Result<Expression>
[src]
pub fn and(lhs: Expression, rhs: Expression) -> Result<Expression>
[src]
pub fn or(lhs: Expression, rhs: Expression) -> Result<Expression>
[src]
pub fn xor(lhs: Expression, rhs: Expression) -> Result<Expression>
[src]
pub fn shl(lhs: Expression, rhs: Expression) -> Result<Expression>
[src]
pub fn shr(lhs: Expression, rhs: Expression) -> Result<Expression>
[src]
pub fn cmpeq(lhs: Expression, rhs: Expression) -> Result<Expression>
[src]
pub fn cmpneq(lhs: Expression, rhs: Expression) -> Result<Expression>
[src]
pub fn cmpltu(lhs: Expression, rhs: Expression) -> Result<Expression>
[src]
Create an unsigned less-than comparison Expression
.
Error
The sort of the lhs and the rhs are not the same.
pub fn cmplts(lhs: Expression, rhs: Expression) -> Result<Expression>
[src]
Create a signed less-than comparison Expression
.
Error
The sort of the lhs and the rhs are not the same.
pub fn zext(bits: usize, src: Expression) -> Result<Expression>
[src]
Create an expression to zero-extend src to the number of bits specified in bits.
Error
src has more or equal number of bits than bits
pub fn sext(bits: usize, src: Expression) -> Result<Expression>
[src]
Create an expression to sign-extend src to the number of bits specified
Error
src has more or equal number of bits than bits
pub fn trun(bits: usize, src: Expression) -> Result<Expression>
[src]
Create an expression to truncate the number of bits in src to the number of bits given.
Error
src has less-than or equal bits than bits
pub fn ite(
cond: Expression,
then: Expression,
else_: Expression
) -> Result<Expression>
[src]
cond: Expression,
then: Expression,
else_: Expression
) -> Result<Expression>
Create an if-than-else expression
Error
condition is not 1-bit, or bitness of then and else_ do not match.
pub fn sra(lhs: Expression, rhs: Expression) -> Result<Expression>
[src]
Perform a shift-right arithmetic
This is a pseudo-expression, and emits an expression with sub-expressions
pub fn rotl(e: Expression, s: Expression) -> Result<Expression>
[src]
Perform a left-rotation
This is a pseudo-expression, and emits an expression with sub-expressions
Trait Implementations
impl Clone for Expression
[src]
fn clone(&self) -> Expression
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Expression
[src]
impl<'de> Deserialize<'de> for Expression
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Display for Expression
[src]
impl Eq for Expression
[src]
impl Hash for Expression
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Into<Expression> for Constant
[src]
fn into(self) -> Expression
[src]
impl Into<Expression> for Scalar
[src]
fn into(self) -> Expression
[src]
impl Ord for Expression
[src]
fn cmp(&self, other: &Expression) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Expression> for Expression
[src]
fn eq(&self, other: &Expression) -> bool
[src]
fn ne(&self, other: &Expression) -> bool
[src]
impl PartialOrd<Expression> for Expression
[src]
fn partial_cmp(&self, other: &Expression) -> Option<Ordering>
[src]
fn lt(&self, other: &Expression) -> bool
[src]
fn le(&self, other: &Expression) -> bool
[src]
fn gt(&self, other: &Expression) -> bool
[src]
fn ge(&self, other: &Expression) -> bool
[src]
impl Serialize for Expression
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for Expression
[src]
impl StructuralPartialEq for Expression
[src]
impl Value for Expression
[src]
fn constant(constant: Constant) -> Self
[src]
fn bits(&self) -> usize
[src]
fn shl(&self, bits: usize) -> Result<Self>
[src]
fn shr(&self, bits: usize) -> Result<Self>
[src]
fn trun(&self, bits: usize) -> Result<Self>
[src]
fn zext(&self, bits: usize) -> Result<Self>
[src]
fn or(&self, other: &Self) -> Result<Self>
[src]
Auto Trait Implementations
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnwindSafe for Expression
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,