decompiler  1.0.0
Public Member Functions | Private Attributes | List of all members
ghidra::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

◆ constructBool()

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.

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

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

◆ evaluatePropagation()

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.

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 ghidra::RuleConditionalMove::applyOp().

◆ initialize()

bool ghidra::RuleConditionalMove::BoolExpress::initialize ( Varnode vn)

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