decompiler 1.0.0
Public Member Functions | Public Attributes | List of all members
ghidra::ConsistencyChecker::OptimizeRecord Struct Reference

Description of how a temporary register is being used within a Constructor. More...

#include <slgh_compile.hh>

Public Member Functions

 OptimizeRecord (uintb offset, int4 size)
 Construct a record, initializing counts. More...
 
 OptimizeRecord (vector< OptimizeRecord * > &records)
 Constructor merging the given overlapping records into a single record. More...
 
void updateRead (int4 i, int4 inslot, int4 secNum)
 Mark this range as being read by a specific op. More...
 
void updateWrite (int4 i, int4 secNum)
 Mark this range as being written by a specific op. More...
 
void updateExport (void)
 Mark this range as exported from the constructor.
 
void updateCombine (OptimizeRecord &that)
 Merge another record's read and write references into this. More...
 

Public Attributes

uintb offset
 Offset of the varnode address.
 
int4 size
 Size in bytes of the varnode or piece (immutable)
 
int4 writeop
 Index of the (last) p-code op writing to register (or -1)
 
int4 readop
 Index of the (last) p-code op reading the register (or -1)
 
int4 inslot
 Input slot of p-code op reading the register (or -1)
 
int4 writecount
 Number of times the register is written.
 
int4 readcount
 Number of times the register is read.
 
int4 writesection
 Section containing (last) p-code op writing to the register (or -2)
 
int4 readsection
 Section containing (last) p-code op reading the register (or -2)
 
int4 opttype
 0 = register read by a COPY, 1 = register written by a COPY (-1 otherwise)
 

Detailed Description

Description of how a temporary register is being used within a Constructor.

This counts reads and writes of the register. If the register is read only once, the particular p-code op and input slot reading it is recorded. If the register is written only once, the particular p-code op writing it is recorded.

Constructor & Destructor Documentation

◆ OptimizeRecord() [1/2]

ghidra::ConsistencyChecker::OptimizeRecord::OptimizeRecord ( uintb  offset,
int4  size 
)
inline

Construct a record, initializing counts.

Parameters
offsetis the starting offset of the temporary range
sizeis the number of bytes in the range

References inslot, offset, opttype, readcount, readop, readsection, size, writecount, writeop, and writesection.

◆ OptimizeRecord() [2/2]

ghidra::ConsistencyChecker::OptimizeRecord::OptimizeRecord ( vector< OptimizeRecord * > &  records)

Constructor merging the given overlapping records into a single record.

Parameters
recordsis the list of records to merge

References inslot, offset, opttype, readcount, readop, readsection, size, updateCombine(), writecount, writeop, and writesection.

Member Function Documentation

◆ updateCombine()

void ghidra::ConsistencyChecker::OptimizeRecord::updateCombine ( ConsistencyChecker::OptimizeRecord &  that)

Merge another record's read and write references into this.

Parameters
thatis the other record to pull read/write info from

References inslot, readcount, readop, readsection, writecount, writeop, and writesection.

Referenced by OptimizeRecord().

◆ updateRead()

void ghidra::ConsistencyChecker::OptimizeRecord::updateRead ( int4  i,
int4  inslot,
int4  secNum 
)

Mark this range as being read by a specific op.

Parameters
iis the index of the op reading the range
inslotis the input slot of the op reading the range
secNumis the constructor section number of the op

◆ updateWrite()

void ghidra::ConsistencyChecker::OptimizeRecord::updateWrite ( int4  i,
int4  secNum 
)

Mark this range as being written by a specific op.

Parameters
iis the index of the op writing to the range
secNumis the constructor section number of the op

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


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