IDA C++ SDK 9.2
Loading...
Searching...
No Matches
callregs_t Class Reference

Register allocation calling convention. More...

#include <typeinf.hpp>

Public Types

enum  reg_kind_t { GPREGS , FPREGS }
 Init registers (sequential) More...

Public Member Functions

 callregs_t ()
 Constructor.
 callregs_t (callcnv_t cc)
 Constructor - initialize with the given request (see init_regs())
void swap (callregs_t &r)
 swap two instances
bool init_regs (callcnv_t cc)
 Init policy & registers for given CC.
bool by_slots () const
void set (argreg_policy_t _policy, const int *gprs, const int *fprs)
 Init policy & registers (arrays are -1-terminated)
void append_registers (reg_kind_t kind, int first_reg, int last_reg)
void set_registers (reg_kind_t kind, int first_reg, int last_reg)
void reset ()
 Set policy and registers to invalid values.
bool reginds (int *gp_ind, int *fp_ind, int r) const
 Get register indexes within GP/FP arrays.

Static Public Member Functions

static int regcount (callcnv_t cc)
 Get max number of registers may be used in a function call.
static int findreg (const intvec_t &regs, int r)

Public Attributes

argreg_policy_t policy = ARGREGS_POLICY_UNDEFINED
 argument policy
int nregs = 0
 max number of registers that can be used in a call
intvec_t gpregs
 array of gp registers (general purpose)
intvec_t fpregs
 array of fp registers (floating point)

Protected Member Functions

bool findregs (int *gp_ind, int *fp_ind, int r, const intvec_t &gprs, const intvec_t &fprs) const
 Search for register r in gprs and fprs.

Detailed Description

Register allocation calling convention.

(allocation policy, arrays of GP and FP registers)

Member Enumeration Documentation

◆ reg_kind_t

Init registers (sequential)

Enumerator
GPREGS 
FPREGS 

Constructor & Destructor Documentation

◆ callregs_t() [1/2]

callregs_t::callregs_t ( )
inline

Constructor.

◆ callregs_t() [2/2]

callregs_t::callregs_t ( callcnv_t cc)
inline

Constructor - initialize with the given request (see init_regs())

Member Function Documentation

◆ swap()

void callregs_t::swap ( callregs_t & r)
inline

swap two instances

◆ init_regs()

bool callregs_t::init_regs ( callcnv_t cc)
inline

Init policy & registers for given CC.

◆ by_slots()

bool callregs_t::by_slots ( ) const
inline

◆ set()

void callregs_t::set ( argreg_policy_t _policy,
const int * gprs,
const int * fprs )
inline

Init policy & registers (arrays are -1-terminated)

◆ append_registers()

void callregs_t::append_registers ( reg_kind_t kind,
int first_reg,
int last_reg )
inline

◆ set_registers()

void callregs_t::set_registers ( reg_kind_t kind,
int first_reg,
int last_reg )
inline

◆ reset()

void callregs_t::reset ( )
inline

Set policy and registers to invalid values.

◆ regcount()

int callregs_t::regcount ( callcnv_t cc)
inlinestatic

Get max number of registers may be used in a function call.

◆ findreg()

int callregs_t::findreg ( const intvec_t & regs,
int r )
inlinestatic

◆ reginds()

bool callregs_t::reginds ( int * gp_ind,
int * fp_ind,
int r ) const
inline

Get register indexes within GP/FP arrays.

(-1 -> is not present in the corresponding array)

◆ findregs()

bool callregs_t::findregs ( int * gp_ind,
int * fp_ind,
int r,
const intvec_t & gprs,
const intvec_t & fprs ) const
inlineprotected

Search for register r in gprs and fprs.

If found, fill gp_ind and fp_ind based on policy

Member Data Documentation

◆ policy

argument policy

◆ nregs

int callregs_t::nregs = 0

max number of registers that can be used in a call

◆ gpregs

intvec_t callregs_t::gpregs

array of gp registers (general purpose)

◆ fpregs

intvec_t callregs_t::fpregs

array of fp registers (floating point)


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