X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Farm%2Farm_cconv.h;h=60bfb686d4d8c323c739647d4417fe18abc56d2b;hb=3c3425a50a1d721b74a015c6812257e32feeac85;hp=1624341aa6eb870867a3e7e7b25bb1cd05b98eca;hpb=d3b7b2aa0a23e144f7e1bf5566eec1bc17e2bf12;p=libfirm diff --git a/ir/be/arm/arm_cconv.h b/ir/be/arm/arm_cconv.h index 1624341aa..60bfb686d 100644 --- a/ir/be/arm/arm_cconv.h +++ b/ir/be/arm/arm_cconv.h @@ -21,49 +21,14 @@ * @file * @brief support functions for calling conventions * @author Matthias Braun - * @version $Id$ */ #ifndef FIRM_BE_ARM_ARM_CCONV_H #define FIRM_BE_ARM_ARM_CCONV_H #include "firm_types.h" -#include "../be_types.h" +#include "be_types.h" #include "gen_arm_regalloc_if.h" -static const arch_register_t *const callee_saves[] = { - &arm_gp_regs[REG_R4], - &arm_gp_regs[REG_R5], - &arm_gp_regs[REG_R6], - &arm_gp_regs[REG_R7], - &arm_gp_regs[REG_R8], - &arm_gp_regs[REG_R9], - &arm_gp_regs[REG_R10], - &arm_gp_regs[REG_R11], - &arm_gp_regs[REG_LR], -}; - -static const arch_register_t *const caller_saves[] = { - &arm_gp_regs[REG_R0], - &arm_gp_regs[REG_R1], - &arm_gp_regs[REG_R2], - &arm_gp_regs[REG_R3], - &arm_gp_regs[REG_LR] -}; - -static const arch_register_t* const param_regs[] = { - &arm_gp_regs[REG_R0], - &arm_gp_regs[REG_R1], - &arm_gp_regs[REG_R2], - &arm_gp_regs[REG_R3] -}; - -static const arch_register_t* const result_regs[] = { - &arm_gp_regs[REG_R0], - &arm_gp_regs[REG_R1], - &arm_gp_regs[REG_R2], - &arm_gp_regs[REG_R3] -}; - /** information about a single parameter or result */ typedef struct reg_or_stackslot_t { @@ -71,7 +36,7 @@ typedef struct reg_or_stackslot_t const arch_register_t *reg1; /**< if != NULL, the second register used. */ ir_type *type; /**< indicates that an entity of the specific type is needed */ - int offset; /**< if transmitted via stack, the offset for this parameter. */ + unsigned offset; /**< if transmitted via stack, the offset for this parameter. */ ir_entity *entity; /**< entity in frame type */ } reg_or_stackslot_t; @@ -79,7 +44,8 @@ typedef struct reg_or_stackslot_t typedef struct calling_convention_t { reg_or_stackslot_t *parameters; /**< parameter info. */ - int param_stack_size; /**< needed stack size for parameters */ + unsigned param_stack_size; /**< needed stack size for parameters */ + unsigned n_reg_params; reg_or_stackslot_t *results; /**< result info. */ } calling_convention_t; @@ -88,11 +54,12 @@ typedef struct calling_convention_t * Decides what goes to register or to stack and what stack offsets/ * datatypes are used. */ -calling_convention_t *decide_calling_convention(ir_type *function_type); +calling_convention_t *arm_decide_calling_convention(const ir_graph *irg, + ir_type *function_type); /** * free memory used by a calling_convention_t */ -void free_calling_convention(calling_convention_t *cconv); +void arm_free_calling_convention(calling_convention_t *cconv); #endif