decompiler  1.0.0
Public Member Functions | Private Attributes | List of all members
RuleConditionalMove::BoolExpress Class Reference

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...
 
VarnodeconstructBool (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.
 
PcodeOpop
 PcodeOp constructing the boolean value.
 
uintb val
 Value (if boolean is constant)
 
Varnodein0
 First input.
 
Varnodein1
 Second input.
 
bool mustreconstruct
 Must make a copy of final boolean operation.
 

Detailed Description

Class for categorizing and rebuilding a boolean expression.

Member Function Documentation

Varnode * 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.

Parameters
insertopis point at which any reconstruction should be inserted
datais the function being analyzed
Returns
the Varnode representing the boolean expression

References Funcdata::newConstant(), Funcdata::newOp(), Funcdata::newUniqueOut(), Funcdata::opInsertBefore(), Funcdata::opSetInput(), and Funcdata::opSetOpcode().

Referenced by RuleConditionalMove::applyOp().

bool 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.

Parameters
rootis the split point
branchis the block on which the expression exists and after which is the merge
Returns
true if the expression can be propagated

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

Parameters
vnis the given root Varnode
Returns
true if it is a boolean expression

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().


The documentation for this class was generated from the following files: