ROSE
0.11.21.0
|
Abstract parameter location.
This class is used to describe the location of a parameter or return value location in a calling convention definition outside any analysis (locations resulting from an analysis often contain more information). The location can be a register, a memory location at a constant address (e.g., global variable), or a memory location relative to some register (e.g., on a stack). Location descriptors are immutable.
The same type is used for input parameters, output parameters, and in-out parameters. Return values are a kind of output parameter, although the API usually does not include the return value when it talks about "parameters".
Definition at line 87 of file BinaryCallingConvention.h.
#include <BinaryCallingConvention.h>
Public Types | |
enum | Type { NO_LOCATION, REGISTER, STACK, ABSOLUTE } |
Type of location. More... | |
Public Member Functions | |
ParameterLocation () | |
Default constructed no-location. More... | |
ParameterLocation (RegisterDescriptor reg) | |
Constructs a parameter in a register location. More... | |
ParameterLocation (RegisterDescriptor reg, int64_t offset) | |
Constructs a parameter at a register-relative memory address. More... | |
ParameterLocation (rose_addr_t va) | |
Constructs a parameter at a fixed memory address. More... | |
Type | type () const |
Type of parameter location. More... | |
bool | isValid () const |
Predicate to determine if location is valid. More... | |
RegisterDescriptor | reg () const |
Register part of location. More... | |
int64_t | offset () const |
Offset part of location. More... | |
rose_addr_t | address () const |
Fixed address location. More... | |
bool | operator== (const ParameterLocation &other) const |
Equality. More... | |
bool | operator!= (const ParameterLocation &other) const |
Inequality. More... | |
void | print (std::ostream &out, const RegisterDictionary *regdict) const |
Print location. | |
void | print (std::ostream &out, const RegisterNames ®names) const |
Print location. | |
Type of location.
Definition at line 90 of file BinaryCallingConvention.h.
|
inline |
Default constructed no-location.
This default constructor is useful for indicating no location or for using an STL container, such as std::vector
, that requires a default constructor. The isValid predicate will return false for default-constructed locations.
Definition at line 127 of file BinaryCallingConvention.h.
|
inlineexplicit |
Constructs a parameter in a register location.
Definition at line 131 of file BinaryCallingConvention.h.
|
inline |
Constructs a parameter at a register-relative memory address.
Definition at line 135 of file BinaryCallingConvention.h.
|
inlineexplicit |
Constructs a parameter at a fixed memory address.
Definition at line 139 of file BinaryCallingConvention.h.
|
inline |
Type of parameter location.
Definition at line 143 of file BinaryCallingConvention.h.
Referenced by isValid().
|
inline |
Predicate to determine if location is valid.
Returns false for default-constructed locations, true for all others.
Definition at line 148 of file BinaryCallingConvention.h.
References NO_LOCATION, and type().
|
inline |
Register part of location.
Returns the register where the parameter is stored (for register parameters) or the register holding the base address for register-relative memory parameters. Returns an invalid (default constructed) register descriptor when invoked on a default constructed location or a fixed memory addresses.
Definition at line 157 of file BinaryCallingConvention.h.
|
inline |
Offset part of location.
Returns the signed byte offset from the base register for register-relative memory parameters. The memory address of the parameter is the contents of the base register plus this byte offset. Returns zero for register parameters, parameters stored at fixed memory addresses, and default constructed locations.
Definition at line 166 of file BinaryCallingConvention.h.
References STACK.
|
inline |
Fixed address location.
Returns the address for a parameter stored at a fixed memory address. Returns zero for register parameters, register-relative (stack) parameters, and default constructed locations.
Definition at line 174 of file BinaryCallingConvention.h.
References ABSOLUTE.
|
inline |
Equality.
Two locations are equal if they are the same type and register, offset, and/or address as appropriate to the type.
Definition at line 181 of file BinaryCallingConvention.h.
|
inline |
Inequality.
Two locations are unequal if they have different types, registers, offsets, or addresses.
Definition at line 188 of file BinaryCallingConvention.h.