2 * This file is part of libFirm.
3 * Copyright (C) 2012 University of Karlsruhe.
8 * @brief support functions for calling conventions
9 * @author Matthias Braun
11 #ifndef FIRM_BE_ARM_ARM_CCONV_H
12 #define FIRM_BE_ARM_ARM_CCONV_H
14 #include "firm_types.h"
16 #include "gen_arm_regalloc_if.h"
18 /** information about a single parameter or result */
19 typedef struct reg_or_stackslot_t
21 const arch_register_t *reg0; /**< if != NULL, the first register used for this parameter. */
22 const arch_register_t *reg1; /**< if != NULL, the second register used. */
23 ir_type *type; /**< indicates that an entity of the specific
25 unsigned offset; /**< if transmitted via stack, the offset for this parameter. */
26 ir_entity *entity; /**< entity in frame type */
29 /** The calling convention info for one call site. */
30 typedef struct calling_convention_t
32 reg_or_stackslot_t *parameters; /**< parameter info. */
33 unsigned param_stack_size; /**< needed stack size for parameters */
34 unsigned n_reg_params;
35 reg_or_stackslot_t *results; /**< result info. */
36 } calling_convention_t;
39 * determine how function parameters and return values are passed.
40 * Decides what goes to register or to stack and what stack offsets/
43 calling_convention_t *arm_decide_calling_convention(const ir_graph *irg,
44 ir_type *function_type);
47 * free memory used by a calling_convention_t
49 void arm_free_calling_convention(calling_convention_t *cconv);