Ghidra Decompiler Analysis Engine
Classes | Public Member Functions | List of all members
LaneDivide Class Reference

Class for splitting data-flow on laned registers. More...

#include <subflow.hh>

Inheritance diagram for LaneDivide:
Inheritance graph
[legend]
Collaboration diagram for LaneDivide:
Collaboration graph
[legend]

Public Member Functions

 LaneDivide (Funcdata *f, Varnode *root, const LaneDescription &desc, bool allowDowncast)
 Constructor. More...
 
bool doTrace (void)
 Trace lanes as far as possible from the root Varnode. More...
 
- Public Member Functions inherited from TransformManager
virtual ~TransformManager (void)
 Destructor.
 
virtual bool preserveAddress (Varnode *vn, int4 bitSize, int4 lsbOffset) const
 Should the address of the given Varnode be preserved when constructing a piece. More...
 
void clearVarnodeMarks (void)
 Clear mark for all Varnodes in the map.
 
TransformVarnewPreexistingVarnode (Varnode *vn)
 Make placeholder for preexisting Varnode. More...
 
TransformVarnewUnique (int4 size)
 Make placeholder for new unique space Varnode. More...
 
TransformVarnewConstant (int4 size, int4 lsbOffset, uintb val)
 Make placeholder for constant Varnode. More...
 
TransformVarnewIop (Varnode *vn)
 Make placeholder for special iop constant. More...
 
TransformVarnewPiece (Varnode *vn, int4 bitSize, int4 lsbOffset)
 Make placeholder for piece of a Varnode. More...
 
TransformVarnewSplit (Varnode *vn, const LaneDescription &description)
 Create placeholder nodes splitting a Varnode into its lanes. More...
 
TransformVarnewSplit (Varnode *vn, const LaneDescription &description, int4 numLanes, int4 startLane)
 Create placeholder nodes splitting a Varnode into a subset of lanes in the given description. More...
 
TransformOpnewOpReplace (int4 numParams, OpCode opc, PcodeOp *replace)
 Create a new placeholder op intended to replace an existing op. More...
 
TransformOpnewOp (int4 numParams, OpCode opc, TransformOp *follow)
 Create a new placeholder op that will not replace an existing op. More...
 
TransformOpnewPreexistingOp (int4 numParams, OpCode opc, PcodeOp *originalOp)
 Create a new placeholder op for an existing PcodeOp. More...
 
TransformVargetPreexistingVarnode (Varnode *vn)
 Get (or create) placeholder for preexisting Varnode. More...
 
TransformVargetPiece (Varnode *vn, int4 bitSize, int4 lsbOffset)
 Get (or create) placeholder piece. More...
 
TransformVargetSplit (Varnode *vn, const LaneDescription &description)
 Find (or create) placeholder nodes splitting a Varnode into its lanes. More...
 
TransformVargetSplit (Varnode *vn, const LaneDescription &description, int4 numLanes, int4 startLane)
 Find (or create) placeholder nodes splitting a Varnode into a subset of lanes from a description. More...
 
void opSetInput (TransformOp *rop, TransformVar *rvn, int4 slot)
 Mark given variable as input to given op. More...
 
void opSetOutput (TransformOp *rop, TransformVar *rvn)
 Mark given variable as output of given op. More...
 
void apply (void)
 Apply the full transform to the function.
 

Additional Inherited Members

- Static Public Member Functions inherited from TransformManager
static bool preexistingGuard (int4 slot, TransformVar *rvn)
 Should newPreexistingOp be called. More...
 

Detailed Description

Class for splitting data-flow on laned registers.

From a root Varnode and a description of its lanes, trace data-flow as far as possible through the function, propagating each lane, using the doTrace() method. Then using the apply() method, data-flow can be split, making each lane in every traced register into an explicit Varnode

Constructor & Destructor Documentation

◆ LaneDivide()

LaneDivide::LaneDivide ( Funcdata f,
Varnode root,
const LaneDescription desc,
bool  allowDowncast 
)

Constructor.

Parameters
fis the function being transformed
rootis the root Varnode to start tracing lanes from
descis a description of the lanes on the root Varnode
allowDowncastis true if we all SUBPIECE to be treated as terminating

Member Function Documentation

◆ doTrace()

bool LaneDivide::doTrace ( void  )

Trace lanes as far as possible from the root Varnode.

Push the lanes around from the root, setting up the explicit transforms as we go. If at any point, the lanes cannot be naturally pushed, return false.

Returns
true if a full transform has been constructed that can split into explicit lanes

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