IDA C++ SDK 9.2
|
Ctree item: expression. More...
#include <hexrays.hpp>
Public Member Functions | |
bool | cpadone () const |
Pointer arithmetic correction done for this expression? | |
bool | is_odd_lvalue () const |
bool | is_fpop () const |
bool | is_cstr () const |
bool | is_type_partial () const |
bool | is_undef_val () const |
bool | is_jumpout () const |
bool | is_vftable () const |
void | set_cpadone () |
void | set_vftable () |
void | set_type_partial (bool val=true) |
cexpr_t () | |
cexpr_t (ctype_t cexpr_op, cexpr_t *_x, cexpr_t *_y=nullptr, cexpr_t *_z=nullptr) | |
cexpr_t (mba_t *mba, const lvar_t &v) | |
cexpr_t (const cexpr_t &r) | |
void | swap (cexpr_t &r) |
cexpr_t & | operator= (const cexpr_t &r) |
cexpr_t &hexapi | assign (const cexpr_t &r) |
DECLARE_COMPARISONS (cexpr_t) | |
~cexpr_t () | |
void hexapi | replace_by (cexpr_t *r) |
Replace the expression. | |
void hexapi | cleanup () |
Cleanup the expression. | |
void hexapi | put_number (cfunc_t *func, uint64 value, int nbytes, type_sign_t sign=no_sign) |
Assign a number to the expression. | |
void hexapi | print1 (qstring *vout, const cfunc_t *func) const |
Print expression into one line. | |
void hexapi | calc_type (bool recursive) |
Calculate the type of the expression. | |
bool hexapi | equal_effect (const cexpr_t &r) const |
Compare two expressions. | |
bool hexapi | is_child_of (const citem_t *parent) const |
Verify if the specified item is our parent. | |
bool hexapi | contains_operator (ctype_t needed_op, int times=1) const |
Check if the expression contains the specified operator. | |
bool | contains_comma (int times=1) const |
Does the expression contain a comma operator? | |
bool | contains_insn (int times=1) const |
Does the expression contain an embedded statement operator? | |
bool | contains_insn_or_label () const |
Does the expression contain an embedded statement operator or a label? | |
bool | contains_comma_or_insn_or_label (int maxcommas=1) const |
Does the expression contain a comma operator or an embedded statement operator or a label? | |
bool | is_nice_expr () const |
Is nice expression? | |
bool | is_nice_cond () const |
Is nice condition? | |
bool | is_call_object_of (const citem_t *parent) const |
Is call object? | |
bool | is_call_arg_of (const citem_t *parent) const |
Is call argument? | |
type_sign_t | get_type_sign () const |
Get expression sign. | |
bool | is_type_unsigned () const |
Is expression unsigned? | |
bool | is_type_signed () const |
Is expression signed? | |
bit_bound_t hexapi | get_high_nbit_bound () const |
Get max number of bits that can really be used by the expression. | |
int hexapi | get_low_nbit_bound () const |
Get min number of bits that are certainly required to represent the expression. | |
bool hexapi | requires_lvalue (const cexpr_t *child) const |
Check if the expression requires an lvalue. | |
bool hexapi | has_side_effects () const |
Check if the expression has side effects. | |
bool | like_boolean () const |
Does the expression look like a boolean expression? | |
bool | is_aliasable () const |
Check if the expression if aliasable. | |
uint64 | numval () const |
Get numeric value of the expression. | |
bool | is_const_value (uint64 _v) const |
Check if the expression is a number with the specified value. | |
bool | is_negative_const () const |
Check if the expression is a negative number. | |
bool | is_non_negative_const () const |
Check if the expression is a non-negative number. | |
bool | is_non_zero_const () const |
Check if the expression is a non-zero number. | |
bool | is_zero_const () const |
Check if the expression is a zero. | |
bool | is_value_used (const citem_t *parent) const |
Does the PARENT need the expression value. | |
bool | get_const_value (uint64 *out) const |
Get expression value. | |
bool hexapi | maybe_ptr () const |
May the expression be a pointer? | |
cexpr_t * | get_ptr_or_array () |
Find pointer or array child. | |
const cexpr_t * | find_op (ctype_t _op) const |
Find the child with the specified operator. | |
cexpr_t * | find_op (ctype_t _op) |
const cexpr_t * | find_num_op () const |
Find the operand with a numeric value. | |
cexpr_t * | find_num_op () |
const cexpr_t * | find_ptr_or_array (bool remove_eqsize_casts) const |
Find the pointer operand. | |
const cexpr_t * | theother (const cexpr_t *what) const |
Get the other operand. | |
cexpr_t * | theother (const cexpr_t *what) |
bool | get_1num_op (cexpr_t **o1, cexpr_t **o2) |
Get pointers to operands. | |
bool | get_1num_op (const cexpr_t **o1, const cexpr_t **o2) const |
const char *hexapi | dstr () const |
Public Member Functions inherited from citem_t | |
citem_t (ctype_t o=cot_empty) | |
void | swap (citem_t &r) |
Swap two citem_t. | |
bool | is_expr () const |
Is an expression? | |
bool hexapi | contains_expr (const cexpr_t *e) const |
Does the item contain an expression? | |
bool hexapi | contains_label () const |
Does the item contain a label? | |
const citem_t *hexapi | find_parent_of (const citem_t *item) const |
Find parent of the specified item. | |
citem_t * | find_parent_of (const citem_t *item) |
citem_t *hexapi | find_closest_addr (ea_t _ea) |
void | print1 (qstring *vout, const cfunc_t *func) const |
Print item into one line. | |
~citem_t () |
Public Attributes | |
union { | |
cnumber_t * n | |
used for cot_num More... | |
fnumber_t * fpc | |
used for cot_fnum More... | |
struct { | |
union { | |
var_ref_t v | |
used for cot_var More... | |
ea_t obj_ea | |
used for cot_obj More... | |
} | |
int refwidth | |
how many bytes are accessed? (-1: none) More... | |
} | |
struct { | |
cexpr_t * x | |
the first operand of the expression More... | |
union { | |
cexpr_t * y | |
the second operand of the expression More... | |
carglist_t * a | |
argument list (used for cot_call) More... | |
uint32 m | |
member offset (used for cot_memptr, cot_memref) for unions, the member number More... | |
} | |
union { | |
cexpr_t * z | |
the third operand of the expression More... | |
int ptrsize | |
memory access size (used for cot_ptr, cot_memptr) More... | |
} | |
} | |
cinsn_t * insn | |
an embedded statement, they are prohibited at the final maturity stage (CMAT_FINAL) More... | |
char * helper | |
helper name (used for cot_helper) More... | |
char * string | |
utf8 string constant, user representation (used for cot_str) More... | |
}; | |
tinfo_t | type |
expression type. must be carefully maintained | |
uint32 | exflags = 0 |
Expression attributes | |
Public Attributes inherited from citem_t | |
ea_t | ea = BADADDR |
address that corresponds to the item. may be BADADDR | |
ctype_t | op |
item type | |
int | label_num = -1 |
label number. | |
int | index = -1 |
an index in cfunc_t::treeitems. |
Ctree item: expression.
Depending on the exact expression item type, various fields of this structure are used.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Pointer arithmetic correction done for this expression?
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
cexpr_t::DECLARE_COMPARISONS | ( | cexpr_t | ) |
Replace the expression.
The children of the expression are abandoned (not freed). The expression pointed by 'r' is moved to 'this' expression
r | the source expression. It is deleted after being copied |
|
inline |
Cleanup the expression.
This function properly deletes all children and sets the item type to cot_empty.
|
inline |
Assign a number to the expression.
func | current function |
value | number value |
nbytes | size of the number in bytes |
sign | number sign |
Print expression into one line.
vout | output buffer |
func | parent function. This argument is used to find out the referenced variable names. |
Calculate the type of the expression.
Use this function to calculate the expression type when a new expression is built
recursive | if true, types of all children expression will be calculated before calculating our type |
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.
r | the expression to compare against the current expression |
Verify if the specified item is our parent.
parent | possible parent item |
Check if the expression contains the specified operator.
needed_op | operator code to search for |
times | how many times the operator code should be present |
|
inline |
Does the expression contain a comma operator?
|
inline |
Does the expression contain an embedded statement operator?
|
inline |
Does the expression contain an embedded statement operator or a label?
|
inline |
Does the expression contain a comma operator or an embedded statement operator or a label?
|
inline |
Is nice expression?
Nice expressions do not contain comma operators, embedded statements, or labels.
|
inline |
Is nice condition?
Nice condition is a nice expression of the boolean type.
Is call object?
Is call argument?
|
inline |
Get expression sign.
|
inline |
Is expression unsigned?
|
inline |
Is expression signed?
|
inline |
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
|
inline |
Get min number of bits that are certainly required to represent the expression.
For example, constant 16 always uses 5 bits: 10000.
Check if the expression requires an lvalue.
child | The function will check if this child of our expression must be an lvalue. |
|
inline |
Check if the expression has side effects.
Calls, pre/post inc/dec, and assignments have side effects.
bool cexpr_t::like_boolean | ( | ) | const |
Does the expression look like a boolean expression?
In other words, its possible values are only 0 and 1.
bool cexpr_t::is_aliasable | ( | ) | const |
Check if the expression if aliasable.
Simple registers and non-aliasble stack slots return false.
|
inline |
Get numeric value of the expression.
This function can be called only on cot_num expressions!
Check if the expression is a number with the specified value.
|
inline |
Check if the expression is a negative number.
|
inline |
Check if the expression is a non-negative number.
|
inline |
Check if the expression is a non-zero number.
|
inline |
Check if the expression is a zero.
Does the PARENT need the expression value.
Get expression value.
out | Pointer to the variable where the expression value is returned. |
|
inline |
May the expression be a pointer?
|
inline |
Find pointer or array child.
Find the child with the specified operator.
|
inline |
Find the operand with a numeric value.
|
inline |
Find the pointer operand.
This function returns the pointer operand for binary expressions.
Get the other operand.
This function returns the other operand (not the specified one) for binary expressions.
Get pointers to operands.
at last one operand should be a number o1 will be pointer to the number
|
inline |
int cexpr_t::refwidth |
how many bytes are accessed? (-1: none)
cexpr_t* cexpr_t::x |
the first operand of the expression
cexpr_t* cexpr_t::y |
the second operand of the expression
carglist_t* cexpr_t::a |
argument list (used for cot_call)
uint32 cexpr_t::m |
member offset (used for cot_memptr, cot_memref) for unions, the member number
cexpr_t* cexpr_t::z |
the third operand of the expression
int cexpr_t::ptrsize |
memory access size (used for cot_ptr, cot_memptr)
cinsn_t* cexpr_t::insn |
an embedded statement, they are prohibited at the final maturity stage (CMAT_FINAL)
char* cexpr_t::helper |
helper name (used for cot_helper)
char* cexpr_t::string |
utf8 string constant, user representation (used for cot_str)
union { ... } cexpr_t |
tinfo_t cexpr_t::type |
expression type. must be carefully maintained
uint32 cexpr_t::exflags = 0 |