Ghidra 11.3.2
Ghidra internal decompiler documentation.
Loading...
Searching...
No Matches
ghidra::TransformOp Class Reference

Placeholder node for PcodeOp that will exist after a transform is applied to a function. More...

#include <transform.hh>

Collaboration diagram for ghidra::TransformOp:
[legend]

Public Types

enum  { op_replacement = 1 , op_preexisting = 2 , indirect_creation = 4 , indirect_creation_possible_out = 8 }
 Special annotations on new pcode ops. More...
 

Public Member Functions

TransformVargetOut (void) const
 Get the output placeholder variable for this operator.
 
TransformVargetIn (int4 i) const
 Get the i-th input placeholder variable for this.
 
void inheritIndirect (PcodeOp *indOp)
 Set indirect creation flags for this based on given INDIRECT.
 

Private Member Functions

void createReplacement (Funcdata *fd)
 Create the new/modified op this placeholder represents.
 
bool attemptInsertion (Funcdata *fd)
 Try to put the new PcodeOp into its basic block.
 

Private Attributes

PcodeOpop
 Original op which this is splitting (or null)
 
PcodeOpreplacement
 The new replacement op.
 
OpCode opc
 Opcode of the new op.
 
uint4 special
 Special handling code when creating.
 
TransformVaroutput
 Varnode output.
 
vector< TransformVar * > input
 Varnode inputs.
 
TransformOpfollow
 The following op after this (if not null)
 

Friends

class TransformManager
 
class TransformVar
 

Detailed Description

Placeholder node for PcodeOp that will exist after a transform is applied to a function.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Special annotations on new pcode ops.

Enumerator
op_replacement 

Op replaces an existing op.

op_preexisting 

Op already exists (but will be transformed)

indirect_creation 

Mark op as indirect creation.

indirect_creation_possible_out 

Mark op as indirect creation and possible call output.

Member Function Documentation

◆ attemptInsertion()

bool ghidra::TransformOp::attemptInsertion ( Funcdata fd)
private

Try to put the new PcodeOp into its basic block.

Parameters
fdis the function into which the PcodeOp will be inserted
Returns
true if the op is successfully inserted or already inserted

References ghidra::CPUI_MULTIEQUAL, follow, ghidra::PcodeOp::getParent(), opc, ghidra::Funcdata::opInsertBefore(), ghidra::Funcdata::opInsertBegin(), and replacement.

◆ createReplacement()

void ghidra::TransformOp::createReplacement ( Funcdata fd)
private

Create the new/modified op this placeholder represents.

Create a new PcodeOp or modify an existing one so that it matches this placeholder description. Go ahead an insert the new PcodeOp into the basic block if possible

Parameters
fdis the function in which to make the modifications

References ghidra::CPUI_MULTIEQUAL, ghidra::TransformVar::createReplacement(), follow, ghidra::PcodeOp::getAddr(), ghidra::PcodeOp::getParent(), input, ghidra::Funcdata::newOp(), ghidra::PcodeOp::numInput(), op, op_preexisting, opc, ghidra::Funcdata::opInsertBefore(), ghidra::Funcdata::opInsertBegin(), ghidra::Funcdata::opInsertInput(), ghidra::Funcdata::opRemoveInput(), ghidra::Funcdata::opSetOpcode(), ghidra::Funcdata::opUnsetInput(), output, replacement, and special.

◆ inheritIndirect()

void ghidra::TransformOp::inheritIndirect ( PcodeOp indOp)

Set indirect creation flags for this based on given INDIRECT.

Prepare to build the transformed INDIRECT PcodeOp based on settings from the given INDIRECT.

Parameters
indOpis the given INDIRECT

References ghidra::PcodeOp::getIn(), indirect_creation, indirect_creation_possible_out, ghidra::PcodeOp::isIndirectCreation(), ghidra::Varnode::isIndirectZero(), and special.

Referenced by ghidra::SplitFlow::addOp(), and ghidra::LaneDivide::buildIndirect().


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