Struct libpatron::ir::Context

source ·
pub struct Context { /* private fields */ }
Expand description

The actual context implementation.

Implementations§

source§

impl Context

source

pub fn add_unique_str(&mut self, value: &str) -> StringRef

ensures that the value is unique (by appending a number if necessary) and then adds it to the store

Trait Implementations§

source§

impl AddNode<&str, StringRef> for Context

source§

fn add_node(&mut self, value: &str) -> StringRef

Add a new value to the context obtaining a reference
source§

impl AddNode<Expr, ExprRef> for Context

source§

fn add_node(&mut self, value: Expr) -> ExprRef

Add a new value to the context obtaining a reference
source§

impl AddNode<String, StringRef> for Context

source§

fn add_node(&mut self, value: String) -> StringRef

Add a new value to the context obtaining a reference
source§

impl Default for Context

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl ExprNodeConstruction for Context

source§

fn bv_symbol(&mut self, name: &str, width: WidthInt) -> ExprRef

source§

fn symbol(&mut self, name: StringRef, tpe: Type) -> ExprRef

source§

fn bv_lit(&mut self, value: BVLiteralInt, width: WidthInt) -> ExprRef

source§

fn zero(&mut self, width: WidthInt) -> ExprRef

source§

fn mask(&mut self, width: WidthInt) -> ExprRef

source§

fn one(&mut self, width: WidthInt) -> ExprRef

source§

fn bv_equal(&mut self, a: ExprRef, b: ExprRef) -> ExprRef

source§

fn bv_ite(&mut self, cond: ExprRef, tru: ExprRef, fals: ExprRef) -> ExprRef

source§

fn array_ite(&mut self, cond: ExprRef, tru: ExprRef, fals: ExprRef) -> ExprRef

source§

fn implies(&mut self, a: ExprRef, b: ExprRef) -> ExprRef

source§

fn greater_signed(&mut self, a: ExprRef, b: ExprRef) -> ExprRef

source§

fn greater(&mut self, a: ExprRef, b: ExprRef) -> ExprRef

source§

fn greater_or_equal_signed(&mut self, a: ExprRef, b: ExprRef) -> ExprRef

source§

fn greater_or_equal(&mut self, a: ExprRef, b: ExprRef) -> ExprRef

source§

fn not(&mut self, e: ExprRef) -> ExprRef

source§

fn and(&mut self, a: ExprRef, b: ExprRef) -> ExprRef

source§

fn or(&mut self, a: ExprRef, b: ExprRef) -> ExprRef

source§

fn xor(&mut self, a: ExprRef, b: ExprRef) -> ExprRef

source§

fn shift_left(&mut self, a: ExprRef, b: ExprRef) -> ExprRef

source§

fn arithmetic_shift_right(&mut self, a: ExprRef, b: ExprRef) -> ExprRef

source§

fn shift_right(&mut self, a: ExprRef, b: ExprRef) -> ExprRef

source§

fn add(&mut self, a: ExprRef, b: ExprRef) -> ExprRef

source§

fn sub(&mut self, a: ExprRef, b: ExprRef) -> ExprRef

source§

fn mul(&mut self, a: ExprRef, b: ExprRef) -> ExprRef

source§

fn div(&mut self, a: ExprRef, b: ExprRef) -> ExprRef

source§

fn signed_div(&mut self, a: ExprRef, b: ExprRef) -> ExprRef

source§

fn signed_mod(&mut self, a: ExprRef, b: ExprRef) -> ExprRef

source§

fn signed_remainder(&mut self, a: ExprRef, b: ExprRef) -> ExprRef

source§

fn remainder(&mut self, a: ExprRef, b: ExprRef) -> ExprRef

source§

fn concat(&mut self, a: ExprRef, b: ExprRef) -> ExprRef

source§

fn slice(&mut self, e: ExprRef, hi: WidthInt, lo: WidthInt) -> ExprRef

source§

fn zero_extend(&mut self, e: ExprRef, by: WidthInt) -> ExprRef

source§

fn sign_extend(&mut self, e: ExprRef, by: WidthInt) -> ExprRef

source§

fn array_store( &mut self, array: ExprRef, index: ExprRef, data: ExprRef ) -> ExprRef

source§

fn array_const(&mut self, e: ExprRef, index_width: WidthInt) -> ExprRef

source§

fn array_read(&mut self, array: ExprRef, index: ExprRef) -> ExprRef

source§

impl GetNode<Expr, ExprRef> for Context

source§

fn get(&self, reference: ExprRef) -> &Expr

Lookup the value by the reference obtained from a call to add
source§

impl GetNode<str, &StringRef> for Context

source§

fn get(&self, reference: &StringRef) -> &str

Lookup the value by the reference obtained from a call to add
source§

impl GetNode<str, StringRef> for Context

source§

fn get(&self, reference: StringRef) -> &str

Lookup the value by the reference obtained from a call to add

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.