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
impl cexpr_t
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)
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>)
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,
)
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)
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
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
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
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
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
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
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
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
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
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
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
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
pub unsafe fn get_type_sign(&self) -> c_int
Get expression sign
pub unsafe fn is_type_unsigned(&self) -> bool
pub unsafe fn is_type_unsigned(&self) -> bool
Is expression unsigned?
pub unsafe fn is_type_signed(&self) -> bool
pub unsafe fn is_type_signed(&self) -> bool
Is expression signed?
pub unsafe fn get_low_nbit_bound(&self) -> c_int
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
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
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
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
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
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
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
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
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
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
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 get_ptr_or_array(self: Pin<&mut Self>) -> *mut cexpr_t
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
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
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
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
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,
)
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
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
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
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
pub unsafe fn find_num_op(self: &cexpr_t) -> *const cexpr_t
Find the operand with a numeric value