2 * Copyright (C) 1995-2008 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"
30 #include "../be_types.h"
31 #include "gen_arm_regalloc_if.h"
33 static const arch_register_t *const callee_saves[] = {
40 &arm_gp_regs[REG_R10],
41 &arm_gp_regs[REG_R11],
45 static const arch_register_t *const caller_saves[] = {
53 static const arch_register_t* const param_regs[] = {
60 static const arch_register_t* const result_regs[] = {
67 /** information about a single parameter or result */
68 typedef struct reg_or_stackslot_t
70 const arch_register_t *reg0;
71 const arch_register_t *reg1;
72 ir_type *type; /**< indicates that an entity of the specific
75 ir_entity *entity; /**< entity in frame type */
78 typedef struct calling_convention_t
80 reg_or_stackslot_t *parameters;
82 reg_or_stackslot_t *results;
83 } calling_convention_t;
86 * determine how function parameters and return values are passed.
87 * Decides what goes to register or to stack and what stack offsets/
90 calling_convention_t *decide_calling_convention(ir_type *function_type);
93 * free memory used by a calling_convention_t
95 void free_calling_convention(calling_convention_t *cconv);