Skip to main content

cexpr_t

Struct cexpr_t 

pub struct cexpr_t { /* private fields */ }
Expand description

Ctree item: expression. Depending on the exact expression item type, various fields of this structure are used.

Implementations§

§

impl cexpr_t

pub unsafe fn cpadone(&self) -> bool

@} Pointer arithmetic correction done for this expression?

pub unsafe fn is_odd_lvalue(&self) -> bool

pub unsafe fn is_fpop(&self) -> bool

pub unsafe fn is_cstr(&self) -> bool

pub unsafe fn is_type_partial(&self) -> bool

pub unsafe fn is_jumpout(&self) -> bool

pub unsafe fn is_user_cast(&self) -> bool

pub unsafe fn set_cpadone(self: Pin<&mut Self>)

pub unsafe fn set_user_cast(self: Pin<&mut Self>)

pub unsafe fn set_type_partial(self: Pin<&mut Self>, val: bool)

pub unsafe fn replace_by(self: Pin<&mut Self>, r: *mut cexpr_t)

Replace the expression. The children of the expression are abandoned (not freed). The expression pointed by ‘r’ is moved to ‘this’ expression \param r the source expression. It is deleted after being copied

pub unsafe fn cleanup(self: Pin<&mut Self>)

Cleanup the expression. This function properly deletes all children and sets the item type to cot_empty.

pub unsafe fn put_number( self: Pin<&mut Self>, func: *mut cfunc_t, value: c_ulonglong, nbytes: usize, sign: c_int, )

Assign a number to the expression. \param func current function \param value number value \param nbytes size of the number in bytes \param sign number sign

pub unsafe fn calc_type(self: Pin<&mut Self>, recursive: bool)

Calculate the type of the expression. Use this function to calculate the expression type when a new expression is built \param recursive if true, types of all children expression will be calculated before calculating our type

pub unsafe fn equal_effect(&self, r: &cexpr_t) -> bool

Compare two expressions. This function tries to compare two expressions in an ‘intelligent’ manner. For example, it knows about commutitive operators and can ignore useless casts. \param r the expression to compare against the current expression \return true expressions can be considered equal

pub unsafe fn is_child_of(&self, parent: *const citem_t) -> bool

Verify if the specified item is our parent. \param parent possible parent item \return true if the specified item is our parent

pub unsafe fn contains_operator(&self, needed_op: ctype_t, times: c_int) -> bool

Check if the expression contains the specified operator. \param needed_op operator code to search for \param times how many times the operator code should be present \return true if the expression has at least TIMES children with NEEDED_OP

pub unsafe fn contains_comma(&self, times: c_int) -> bool

Does the expression contain a comma operator?

pub unsafe fn contains_insn(&self, times: c_int) -> bool

Does the expression contain an embedded statement operator?

pub unsafe fn contains_insn_or_label(&self) -> bool

Does the expression contain an embedded statement operator or a label?

pub unsafe fn contains_comma_or_insn_or_label(&self, maxcommas: c_int) -> bool

Does the expression contain a comma operator or an embedded statement operator or a label?

pub unsafe fn is_nice_expr(&self) -> bool

Is nice expression? Nice expressions do not contain comma operators, embedded statements, or labels.

pub unsafe fn is_nice_cond(&self) -> bool

Is nice condition?. Nice condition is a nice expression of the boolean type.

pub unsafe fn is_call_object_of(&self, parent: *const citem_t) -> bool

Is call object? \return true if our expression is the call object of the specified parent expression.

pub unsafe fn is_call_arg_of(&self, parent: *const citem_t) -> bool

Is call argument? \return true if our expression is a call argument of the specified parent expression.

pub unsafe fn get_type_sign(&self) -> c_int

Get expression sign

pub unsafe fn is_type_unsigned(&self) -> bool

Is expression unsigned?

pub unsafe fn is_type_signed(&self) -> bool

Is expression signed?

pub unsafe fn get_low_nbit_bound(&self) -> c_int

Get min number of bits that are certainly required to represent the expression. For example, constant 16 always uses 5 bits: 10000.

pub unsafe fn requires_lvalue(&self, child: *const cexpr_t) -> bool

Check if the expression requires an lvalue. \param child The function will check if this child of our expression must be an lvalue. \return true if child must be an lvalue.

pub unsafe fn like_boolean(&self) -> bool

Does the expression look like a boolean expression? In other words, its possible values are only 0 and 1.

pub unsafe fn numval(&self) -> c_ulonglong

Get numeric value of the expression. This function can be called only on cot_num expressions!

pub unsafe fn is_const_value(&self, _v: c_ulonglong) -> bool

Check if the expression is a number with the specified value.

pub unsafe fn is_negative_const(&self) -> bool

Check if the expression is a negative number.

pub unsafe fn is_non_negative_const(&self) -> bool

Check if the expression is a non-negative number.

pub unsafe fn is_non_zero_const(&self) -> bool

Check if the expression is a non-zero number.

pub unsafe fn is_zero_const(&self) -> bool

Check if the expression is a zero.

pub unsafe fn is_value_used(&self, parent: *const citem_t) -> bool

Does the PARENT need the expression value

pub unsafe fn get_const_value(&self, out: *mut c_ulonglong) -> bool

Get expression value. \param out Pointer to the variable where the expression value is returned. \return true if the expression is a number.

pub unsafe fn maybe_ptr(&self) -> bool

May the expression be a pointer?

pub unsafe fn get_ptr_or_array(self: Pin<&mut Self>) -> *mut cexpr_t

Find pointer or array child.

pub unsafe fn find_op(&self, _op: ctype_t) -> *const cexpr_t

Find the child with the specified operator.

pub unsafe fn find_op1(self: Pin<&mut Self>, _op: ctype_t) -> *mut cexpr_t

pub unsafe fn find_ptr_or_array( &self, remove_eqsize_casts: bool, ) -> *const cexpr_t

Find the pointer operand. This function returns the pointer operand for binary expressions.

pub unsafe fn theother(&self, what: *const cexpr_t) -> *const cexpr_t

Get the other operand. This function returns the other operand (not the specified one) for binary expressions.

pub unsafe fn theother1( self: Pin<&mut Self>, what: *const cexpr_t, ) -> *mut cexpr_t

§

impl cexpr_t

pub unsafe fn is_undef_val(self: &cexpr_t) -> bool

pub unsafe fn is_vftable(self: &cexpr_t) -> bool

pub unsafe fn set_vftable(self: Pin<&mut cexpr_t>)

pub unsafe fn swap(self: Pin<&mut cexpr_t>, r: Pin<&mut cexpr_t>)

pub unsafe fn compare(self: &cexpr_t, r: &cexpr_t) -> c_int

pub unsafe fn print1( self: &cexpr_t, vout: *mut qstring_char_AutocxxConcrete, func: *const cfunc_t, )

Print expression into one line. \param vout output buffer \param func parent function. This argument is used to find out the referenced variable names.

pub unsafe fn get_high_nbit_bound<'a>( self: &'a cexpr_t, ) -> impl New<Output = bit_bound_t> + 'a

Get max number of bits that can really be used by the expression. For example, x % 16 can yield only 4 non-zero bits, higher bits are zero

pub unsafe fn has_side_effects(self: &cexpr_t) -> bool

Check if the expression has side effects. Calls, pre/post inc/dec, and assignments have side effects.

pub unsafe fn is_aliasable(self: &cexpr_t) -> bool

Check if the expression if aliasable. Simple registers and non-aliasble stack slots return false.

pub unsafe fn find_num_op(self: &cexpr_t) -> *const cexpr_t

Find the operand with a numeric value

pub unsafe fn find_num_op1(self: Pin<&mut cexpr_t>) -> *mut cexpr_t

pub unsafe fn dstr(self: &cexpr_t) -> *const c_char

pub unsafe fn new() -> impl New<Output = Self>

pub unsafe fn new1( cexpr_op: ctype_t, _x: *mut cexpr_t, _y: *mut cexpr_t, _z: *mut cexpr_t, ) -> impl New<Output = Self>

pub unsafe fn new2<'a>( mba: *mut mba_t, v: &'a lvar_t, ) -> impl New<Output = Self> + 'a

Trait Implementations§

§

impl AsRef<cexpr_t> for carg_t

§

fn as_ref(self: &carg_t) -> &cexpr_t

Converts this type into a shared reference of the (usually inferred) input type.
§

impl AsRef<citem_t> for cexpr_t

§

fn as_ref(self: &cexpr_t) -> &citem_t

Converts this type into a shared reference of the (usually inferred) input type.
§

impl CopyNew for cexpr_t

§

unsafe fn copy_new(r: &cexpr_t, this: Pin<&mut MaybeUninit<cexpr_t>>)

Copy-construct src into this, effectively re-pinning it at a new location. Read more
§

impl Drop for cexpr_t

§

fn drop(self: &mut cexpr_t)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
§

impl ExternType for cexpr_t

§

type Id = (c, e, x, p, r, __, t)

A type-level representation of the type’s C++ namespace and type name. Read more
§

type Kind = Opaque

§

impl MakeCppStorage for cexpr_t

§

unsafe fn allocate_uninitialized_cpp_storage() -> *mut cexpr_t

Allocates heap space for this type in C++ and return a pointer to that space, but do not initialize that space (i.e. do not yet call a constructor). Read more
§

unsafe fn free_uninitialized_cpp_storage(arg0: *mut cexpr_t)

Frees a C++ allocation which has not yet had a constructor called. Read more
§

impl SharedPtrTarget for cexpr_t

§

impl UniquePtrTarget for cexpr_t

§

impl WeakPtrTarget for cexpr_t

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>,

Source§

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>,

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.