/*
- * Copyright (C) 1995-2010 University of Karlsruhe. All right reserved.
+ * Copyright (C) 1995-2011 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
const arch_env_t *arch_env = be_get_irg_arch_env(irg);
ir_type *call_tp = get_Call_type(irn);
ir_node *call_ptr = get_Call_ptr(irn);
- int n_params = get_method_n_params(call_tp);
+ size_t n_params = get_method_n_params(call_tp);
ir_node *curr_mem = get_Call_mem(irn);
ir_node *bl = get_nodes_block(irn);
int stack_size = 0;
int *reg_param_idxs;
int *stack_param_idx;
int i, n, destroy_all_regs;
+ size_t s;
+ size_t p;
dbg_info *dbgi;
/* Let the isa fill out the abi description for that call node. */
/* Insert code to put the stack arguments on the stack. */
assert(get_Call_n_params(irn) == n_params);
stack_param_idx = ALLOCAN(int, n_params);
- for (i = 0; i < n_params; ++i) {
- be_abi_call_arg_t *arg = get_call_arg(call, 0, i, 0);
+ for (p = 0; p < n_params; ++p) {
+ be_abi_call_arg_t *arg = get_call_arg(call, 0, p, 0);
assert(arg);
if (arg->on_stack) {
- int arg_size = get_type_size_bytes(get_method_param_type(call_tp, i));
+ int arg_size = get_type_size_bytes(get_method_param_type(call_tp, p));
stack_size += round_up2(arg->space_before, arg->alignment);
stack_size += round_up2(arg_size, arg->alignment);
stack_size += round_up2(arg->space_after, arg->alignment);
- stack_param_idx[n_stack_params++] = i;
+ stack_param_idx[n_stack_params++] = p;
}
}
/* Collect all arguments which are passed in registers. */
reg_param_idxs = ALLOCAN(int, n_params);
- for (i = 0; i < n_params; ++i) {
- be_abi_call_arg_t *arg = get_call_arg(call, 0, i, 0);
+ for (p = 0; p < n_params; ++p) {
+ be_abi_call_arg_t *arg = get_call_arg(call, 0, p, 0);
if (arg && arg->in_reg) {
- reg_param_idxs[n_reg_params++] = i;
+ reg_param_idxs[n_reg_params++] = p;
}
}
}
/* add state registers ins */
- for (i = 0; i < ARR_LEN(states); ++i) {
- const arch_register_t *reg = states[i];
+ for (s = 0; s < ARR_LEN(states); ++s) {
+ const arch_register_t *reg = states[s];
const arch_register_class_t *cls = arch_register_get_class(reg);
#if 0
ir_node *regnode = be_abi_reg_map_get(env->regs, reg);
if (arg->in_reg) {
/* remove register from destroyed regs */
- int j;
- int n = ARR_LEN(destroyed_regs);
+ size_t j;
+ size_t n = ARR_LEN(destroyed_regs);
for (j = 0; j < n; ++j) {
if (destroyed_regs[j] == arg->reg) {
destroyed_regs[j] = destroyed_regs[n-1];
{
ir_node **in, *keep;
int i;
+ size_t d;
int n = 0;
int curr_res_proj = pn_be_Call_first_res + n_reg_results;
int n_ins;
set_irn_link(curr_sp, (void*) sp);
in[n++] = curr_sp;
- for (i = 0; i < ARR_LEN(destroyed_regs); ++i) {
- const arch_register_t *reg = destroyed_regs[i];
+ for (d = 0; d < ARR_LEN(destroyed_regs); ++d) {
+ const arch_register_t *reg = destroyed_regs[d];
ir_node *proj = new_r_Proj(low_call, reg->reg_class->mode, curr_res_proj);
/* memorize the register in the link field. we need afterwards to set the register class of the keep correctly. */
static void reg_map_to_arr(reg_node_map_t *res, pmap *reg_map)
{
pmap_entry *ent;
- int n = pmap_count(reg_map);
- int i = 0;
+ size_t n = pmap_count(reg_map);
+ size_t i = 0;
foreach_pmap(reg_map, ent) {
res[i].reg = (const arch_register_t*)ent->key;
dbg_info *dbgi;
pmap *reg_map = pmap_create();
ir_node *keep = (ir_node*)pmap_get(env->keep_map, bl);
- int in_max;
+ size_t in_max;
ir_node *ret;
int i, n;
unsigned pop;