decompiler
1.0.0
|
Class for categorizing and rebuilding a boolean expression. More...
Public Member Functions | |
bool | isConstant (void) const |
Return true if boolean is a constant. | |
uintb | getVal (void) const |
Get the constant boolean value. | |
bool | initialize (Varnode *vn) |
Initialize based on output Varnode. More... | |
bool | evaluatePropagation (FlowBlock *root, FlowBlock *branch) |
Can this expression be propagated. More... | |
Varnode * | constructBool (PcodeOp *insertop, Funcdata &data) |
Construct the expression after the merge. More... | |
Private Attributes | |
int4 | optype |
0=constant 1=unary 2=binary | |
OpCode | opc |
OpCode constructing the boolean value. | |
PcodeOp * | op |
PcodeOp constructing the boolean value. | |
uintb | val |
Value (if boolean is constant) | |
Varnode * | in0 |
First input. | |
Varnode * | in1 |
Second input. | |
bool | mustreconstruct |
Must make a copy of final boolean operation. | |
Class for categorizing and rebuilding a boolean expression.
Construct the expression after the merge.
Produce the boolean Varnode to use after the merge. Either reuse the existing Varnode or reconstruct it, making sure the expression does not depend on data in the branch.
insertop | is point at which any reconstruction should be inserted |
data | is the function being analyzed |
References Funcdata::newConstant(), Funcdata::newOp(), Funcdata::newUniqueOut(), Funcdata::opInsertBefore(), Funcdata::opSetInput(), and Funcdata::opSetOpcode().
Referenced by RuleConditionalMove::applyOp().
Can this expression be propagated.
Evaluate if this expression can be easily propagated past a merge point. Also can the Varnode be used past the merge, or does its value need to be reconstructed.
root | is the split point |
branch | is the block on which the expression exists and after which is the merge |
Referenced by RuleConditionalMove::applyOp().
bool RuleConditionalMove::BoolExpress::initialize | ( | Varnode * | vn | ) |
Initialize based on output Varnode.
Check if given Varnode is a boolean value and break down its construction. Varnode is assumed to be an input to a MULTIEQUAL
vn | is the given root Varnode |
References PcodeOp::code(), CPUI_BOOL_AND, CPUI_BOOL_NEGATE, CPUI_BOOL_OR, CPUI_BOOL_XOR, CPUI_COPY, CPUI_FLOAT_EQUAL, CPUI_FLOAT_LESS, CPUI_FLOAT_LESSEQUAL, CPUI_FLOAT_NAN, CPUI_FLOAT_NOTEQUAL, CPUI_INT_CARRY, CPUI_INT_EQUAL, CPUI_INT_LESS, CPUI_INT_LESSEQUAL, CPUI_INT_NOTEQUAL, CPUI_INT_SBORROW, CPUI_INT_SCARRY, CPUI_INT_SLESS, CPUI_INT_SLESSEQUAL, Varnode::getDef(), and Varnode::isWritten().
Referenced by RuleConditionalMove::applyOp().