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.
Varnode * ghidra::RuleConditionalMove::BoolExpress::constructBool | ( | PcodeOp * | insertop, |
Funcdata & | data | ||
) |
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 ghidra::Funcdata::newConstant(), ghidra::Funcdata::newOp(), ghidra::Funcdata::newUniqueOut(), ghidra::Funcdata::opInsertBefore(), ghidra::Funcdata::opSetInput(), and ghidra::Funcdata::opSetOpcode().
Referenced by ghidra::RuleConditionalMove::applyOp().
bool ghidra::RuleConditionalMove::BoolExpress::evaluatePropagation | ( | FlowBlock * | root, |
FlowBlock * | branch | ||
) |
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 ghidra::RuleConditionalMove::applyOp().
bool ghidra::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 ghidra::PcodeOp::code(), ghidra::CPUI_BOOL_AND, ghidra::CPUI_BOOL_NEGATE, ghidra::CPUI_BOOL_OR, ghidra::CPUI_BOOL_XOR, ghidra::CPUI_COPY, ghidra::CPUI_FLOAT_EQUAL, ghidra::CPUI_FLOAT_LESS, ghidra::CPUI_FLOAT_LESSEQUAL, ghidra::CPUI_FLOAT_NAN, ghidra::CPUI_FLOAT_NOTEQUAL, ghidra::CPUI_INT_CARRY, ghidra::CPUI_INT_EQUAL, ghidra::CPUI_INT_LESS, ghidra::CPUI_INT_LESSEQUAL, ghidra::CPUI_INT_NOTEQUAL, ghidra::CPUI_INT_SBORROW, ghidra::CPUI_INT_SCARRY, ghidra::CPUI_INT_SLESS, ghidra::CPUI_INT_SLESSEQUAL, ghidra::Varnode::getDef(), and ghidra::Varnode::isWritten().
Referenced by ghidra::RuleConditionalMove::applyOp().