decompiler 1.0.0
Public Member Functions | Private Attributes | List of all members
ghidra::OpTpl Class Reference

A p-code operation in a SLEIGH specification. More...

#include <semantics.hh>

Public Member Functions

 OpTpl (void)
 Construct an uninitialized OpTpl.
 
 OpTpl (OpCode oc)
 Construct an OpTpl with not inputs or output.
 
 ~OpTpl (void)
 Destructor. More...
 
VarnodeTpl * getOut (void) const
 Get the output VarnodeTpl (or NULL)
 
int4 numInput (void) const
 Return the number of inputs to this.
 
VarnodeTpl * getIn (int4 i) const
 Get the i-th input VarnodeTpl.
 
OpCode getOpcode (void) const
 Get the operation code.
 
bool isZeroSize (void) const
 Return true if any input or output has zero size.
 
void setOpcode (OpCode o)
 Set the operation code.
 
void setOutput (VarnodeTpl *vt)
 Set the output VarnodeTpl.
 
void clearOutput (void)
 Remove the existing output VarnodeTpl.
 
void addInput (VarnodeTpl *vt)
 Add an input VarnodeTpl.
 
void setInput (VarnodeTpl *vt, int4 slot)
 Set the VarnodeTpl for a specific input slot.
 
void removeInput (int4 index)
 Remove the indicated input. More...
 
void changeHandleIndex (const vector< int4 > &handmap)
 Remap any handle indices for inputs and outputs to this. More...
 
void encode (Encoder &encoder) const
 Encode this OpTpl to an output stream. More...
 
void decode (Decoder &decoder)
 Decode this OpTpl from a stream. More...
 

Private Attributes

VarnodeTpl * output
 The output variable of the operation, or NULL.
 
OpCode opc
 The code describing the operation.
 
vector< VarnodeTpl * > input
 Inputs to the operation.
 

Detailed Description

A p-code operation in a SLEIGH specification.

Each input and output to the operation is a VarnodeTpl.

Constructor & Destructor Documentation

◆ ~OpTpl()

ghidra::OpTpl::~OpTpl ( void  )

Destructor.

An OpTpl owns its VarnodeTpl.

References input, and output.

Member Function Documentation

◆ changeHandleIndex()

void ghidra::OpTpl::changeHandleIndex ( const vector< int4 > &  handmap)

Remap any handle indices for inputs and outputs to this.

This is used to help reorder sub-constructors. Each input and output VarnodeTpl is remapped using the given array of handle indices

Parameters
handmapis the given array of new handle indices

References ghidra::VarnodeTpl::changeHandleIndex(), input, and output.

Referenced by ghidra::ConstructTpl::changeHandleIndex().

◆ decode()

void ghidra::OpTpl::decode ( Decoder &  decoder)

◆ encode()

void ghidra::OpTpl::encode ( Encoder &  encoder) const

Encode this OpTpl to an output stream.

Parameters
encoderis the output stream

References ghidra::Encoder::closeElement(), ghidra::VarnodeTpl::encode(), encode(), input, opc, ghidra::Encoder::openElement(), output, and ghidra::Encoder::writeOpcode().

Referenced by encode().

◆ removeInput()

void ghidra::OpTpl::removeInput ( int4  index)

Remove the indicated input.

Parameters
indexis the index of the input to remove

References input.

Referenced by ghidra::ConsistencyChecker::dealWithUnnecessaryTrunc().


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