2 * Copyright (C) 1995-2010 University of Karlsruhe. All right reserved.
4 * This file is part of libFirm.
6 * This file may be distributed and/or modified under the terms of the
7 * GNU General Public License version 2 as published by the Free Software
8 * Foundation and appearing in the file LICENSE.GPL included in the
9 * packaging of this file.
11 * Licensees holding valid libFirm Professional Edition licenses may use
12 * this file in accordance with the libFirm Commercial License.
13 * Agreement provided with the Software.
15 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * @brief support functions for calling conventions
23 * @author Matthias Braun
26 #ifndef FIRM_BE_ARM_ARM_CCONV_H
27 #define FIRM_BE_ARM_ARM_CCONV_H
29 #include "firm_types.h"
31 #include "gen_arm_regalloc_if.h"
33 /** information about a single parameter or result */
34 typedef struct reg_or_stackslot_t
36 const arch_register_t *reg0; /**< if != NULL, the first register used for this parameter. */
37 const arch_register_t *reg1; /**< if != NULL, the second register used. */
38 ir_type *type; /**< indicates that an entity of the specific
40 unsigned offset; /**< if transmitted via stack, the offset for this parameter. */
41 ir_entity *entity; /**< entity in frame type */
44 /** The calling convention info for one call site. */
45 typedef struct calling_convention_t
47 reg_or_stackslot_t *parameters; /**< parameter info. */
48 unsigned param_stack_size; /**< needed stack size for parameters */
49 unsigned n_reg_params;
50 reg_or_stackslot_t *results; /**< result info. */
51 } calling_convention_t;
54 * determine how function parameters and return values are passed.
55 * Decides what goes to register or to stack and what stack offsets/
58 calling_convention_t *arm_decide_calling_convention(const ir_graph *irg,
59 ir_type *function_type);
62 * free memory used by a calling_convention_t
64 void arm_free_calling_convention(calling_convention_t *cconv);