libFirm 1.20
|
A method type represents a method, function or procedure type. More...
Defines | |
#define | cc_cdecl_set (0) |
cdecl calling convention | |
#define | cc_stdcall_set cc_callee_clear_stk |
stdcall calling convention | |
#define | cc_fastcall_set (cc_reg_param|cc_callee_clear_stk) |
fastcall calling convention | |
#define | IS_CDECL(cc_mask) (((cc_mask) & cc_bits) == cc_cdecl_set) |
check for the CDECL calling convention | |
#define | IS_STDCALL(cc_mask) (((cc_mask) & cc_bits) == cc_stdcall_set) |
check for the STDCALL calling convention | |
#define | IS_FASTCALL(cc_mask) (((cc_mask) & cc_bits) == cc_fastcall_set) |
check for the FASTCALL calling convention | |
#define | SET_CDECL(cc_mask) (((cc_mask) & ~cc_bits) | cc_cdecl_set) |
Sets the CDECL convention bits. | |
#define | SET_STDCALL(cc_mask) (((cc_mask) & ~cc_bits) | cc_stdcall_set) |
Sets the STDCALL convention bits. | |
#define | SET_FASTCALL(cc_mask) (((cc_mask) & ~cc_bits) | cc_fastcall_set) |
Sets the FASTCALL convention bits. | |
Enumerations | |
enum | mtp_additional_properties { mtp_no_property = 0x00000000, mtp_property_const = 0x00000001, mtp_property_pure = 0x00000002, mtp_property_noreturn = 0x00000004, mtp_property_nothrow = 0x00000008, mtp_property_naked = 0x00000010, mtp_property_malloc = 0x00000020, mtp_property_returns_twice = 0x00000040, mtp_property_intrinsic = 0x00000080, mtp_property_runtime = 0x00000100, mtp_property_private = 0x00000200, mtp_property_has_loop = 0x00000400, mtp_property_inherited = (1<<31) } |
Additional method type properties: Tell about special properties of a method type. More... | |
enum | ir_variadicity { variadicity_non_variadic, variadicity_variadic } |
This enum flags the variadicity of methods (methods with a variable amount of arguments (e.g. More... | |
enum | calling_convention { cc_reg_param = 0x01000000, cc_last_on_top = 0x02000000, cc_callee_clear_stk = 0x04000000, cc_this_call = 0x08000000, cc_compound_ret = 0x10000000, cc_frame_on_caller_stk = 0x20000000, cc_fpreg_param = 0x40000000, cc_bits = (0xFF << 24) } |
Calling conventions: lower 24 bits are the number of register parameters, upper 8 encode the calling conventions. More... | |
Functions | |
ir_type * | new_type_method (size_t n_param, size_t n_res) |
Create a new method type. | |
ir_type * | new_d_type_method (size_t n_param, size_t n_res, type_dbg_info *db) |
Create a new method type with debug information. | |
size_t | get_method_n_params (const ir_type *method) |
Returns the number of parameters of this method. | |
ir_type * | get_method_param_type (const ir_type *method, size_t pos) |
Returns the type of the parameter at position pos of a method. | |
void | set_method_param_type (ir_type *method, size_t pos, ir_type *tp) |
Sets the type of the parameter at position pos of a method. | |
size_t | get_method_n_ress (const ir_type *method) |
Returns the number of results of a method type. | |
ir_type * | get_method_res_type (const ir_type *method, size_t pos) |
Returns the return type of a method type at position pos. | |
void | set_method_res_type (ir_type *method, size_t pos, ir_type *tp) |
Sets the type of the result at position pos of a method. | |
const char * | get_variadicity_name (ir_variadicity vari) |
Returns the null-terminated name of this variadicity. | |
ir_variadicity | get_method_variadicity (const ir_type *method) |
Returns the variadicity of a method. | |
void | set_method_variadicity (ir_type *method, ir_variadicity vari) |
Sets the variadicity of a method. | |
mtp_additional_properties | get_method_additional_properties (const ir_type *method) |
Returns the mask of the additional graph properties. | |
void | set_method_additional_properties (ir_type *method, mtp_additional_properties property_mask) |
Sets the mask of the additional graph properties. | |
void | add_method_additional_properties (ir_type *method, mtp_additional_properties flag) |
Sets one additional graph property. | |
unsigned | get_method_calling_convention (const ir_type *method) |
Returns the calling convention of an entities graph. | |
void | set_method_calling_convention (ir_type *method, unsigned cc_mask) |
Sets the calling convention of an entities graph. | |
unsigned | get_method_n_regparams (ir_type *method) |
Returns the number of registers parameters, 0 means default. | |
void | set_method_n_regparams (ir_type *method, unsigned n_regs) |
Sets the number of registers parameters, 0 means default. | |
int | is_Method_type (const ir_type *method) |
Returns true if a type is a method type. | |
const tp_op * | get_tpop_method (void) |
Returns type opcode for method type. | |
Variables | |
const tp_op * | type_method |
This type opcode marks that the corresponding type is a method type. |
A method type represents a method, function or procedure type.
It contains a list of the parameter and result types, as these are part of the type description. These lists should not be changed by a optimization, as a change creates a new method type. Therefore optimizations should allocated new method types. The set_ routines are only for construction by a frontend.
#define cc_fastcall_set (cc_reg_param|cc_callee_clear_stk) |
#define cc_stdcall_set cc_callee_clear_stk |
#define IS_CDECL | ( | cc_mask | ) | (((cc_mask) & cc_bits) == cc_cdecl_set) |
#define IS_FASTCALL | ( | cc_mask | ) | (((cc_mask) & cc_bits) == cc_fastcall_set) |
#define IS_STDCALL | ( | cc_mask | ) | (((cc_mask) & cc_bits) == cc_stdcall_set) |
#define SET_CDECL | ( | cc_mask | ) | (((cc_mask) & ~cc_bits) | cc_cdecl_set) |
#define SET_FASTCALL | ( | cc_mask | ) | (((cc_mask) & ~cc_bits) | cc_fastcall_set) |
#define SET_STDCALL | ( | cc_mask | ) | (((cc_mask) & ~cc_bits) | cc_stdcall_set) |
enum calling_convention |
Calling conventions: lower 24 bits are the number of register parameters, upper 8 encode the calling conventions.
enum ir_variadicity |
Additional method type properties: Tell about special properties of a method type.
Some of these may be discovered by analyses.
Definition at line 254 of file firm_types.h.
void add_method_additional_properties | ( | ir_type * | method, |
mtp_additional_properties | flag | ||
) |
Sets one additional graph property.
mtp_additional_properties get_method_additional_properties | ( | const ir_type * | method | ) |
Returns the mask of the additional graph properties.
unsigned get_method_calling_convention | ( | const ir_type * | method | ) |
Returns the calling convention of an entities graph.
size_t get_method_n_params | ( | const ir_type * | method | ) |
Returns the number of parameters of this method.
unsigned get_method_n_regparams | ( | ir_type * | method | ) |
Returns the number of registers parameters, 0 means default.
size_t get_method_n_ress | ( | const ir_type * | method | ) |
Returns the number of results of a method type.
Returns the type of the parameter at position pos of a method.
Returns the return type of a method type at position pos.
ir_variadicity get_method_variadicity | ( | const ir_type * | method | ) |
Returns the variadicity of a method.
const tp_op* get_tpop_method | ( | void | ) |
Returns type opcode for method type.
const char* get_variadicity_name | ( | ir_variadicity | vari | ) |
Returns the null-terminated name of this variadicity.
int is_Method_type | ( | const ir_type * | method | ) |
Returns true if a type is a method type.
ir_type* new_d_type_method | ( | size_t | n_param, |
size_t | n_res, | ||
type_dbg_info * | db | ||
) |
Create a new method type with debug information.
n_param | the number of parameters |
n_res | the number of results |
db | user defined debug information |
The arrays for the parameter and result types are not initialized by the constructor.
ir_type* new_type_method | ( | size_t | n_param, |
size_t | n_res | ||
) |
Create a new method type.
n_param | the number of parameters |
n_res | the number of results |
The arrays for the parameter and result types are not initialized by the constructor.
void set_method_additional_properties | ( | ir_type * | method, |
mtp_additional_properties | property_mask | ||
) |
Sets the mask of the additional graph properties.
void set_method_calling_convention | ( | ir_type * | method, |
unsigned | cc_mask | ||
) |
Sets the calling convention of an entities graph.
void set_method_n_regparams | ( | ir_type * | method, |
unsigned | n_regs | ||
) |
Sets the number of registers parameters, 0 means default.
Sets the type of the parameter at position pos of a method.
Note: does not change the corresponding parameter entities (if there are any)
Sets the type of the result at position pos of a method.
void set_method_variadicity | ( | ir_type * | method, |
ir_variadicity | vari | ||
) |
Sets the variadicity of a method.
const tp_op* type_method |