Commit 270f2356 authored by Matthias Braun's avatar Matthias Braun
Browse files

further spread size_t (all warnings on linux/gcc fixed)

[r28340]
parent 92a8cd23
......@@ -42,7 +42,7 @@
* If the pos'th parameter is NOT of a pointer type, ptr_access_none
* is returned;
*/
FIRM_API ptr_access_kind get_method_param_access(ir_entity *ent, int pos);
FIRM_API ptr_access_kind get_method_param_access(ir_entity *ent, size_t pos);
/**
* Analyze how pointer arguments of a given
......@@ -59,7 +59,7 @@ FIRM_API void analyze_irg_args(ir_graph *irg);
*
* The values are calculation on demand only.
*/
FIRM_API unsigned get_method_param_weight(ir_entity *ent, int pos);
FIRM_API unsigned get_method_param_weight(ir_entity *ent, size_t pos);
/**
* Analyze the parameters of a given ir graph.
......
......@@ -370,7 +370,7 @@ FIRM_API void remove_End_Bads_and_doublets(ir_node *end);
FIRM_API void free_End(ir_node *end);
FIRM_API ir_node **get_Return_res_arr(ir_node *node);
FIRM_API int get_Return_n_ress(const ir_node *node);
FIRM_API size_t get_Return_n_ress(const ir_node *node);
FIRM_API ir_node *get_Return_res(const ir_node *node, int pos);
FIRM_API void set_Return_res(ir_node *node, int pos, ir_node *res);
......@@ -429,7 +429,7 @@ FIRM_API void set_Sel_index(ir_node *node, int pos, ir_node *index);
FIRM_API ir_node **get_Call_param_arr(ir_node *node);
/** Gets the number of parameters of a call. */
FIRM_API int get_Call_n_params(const ir_node *node);
FIRM_API size_t get_Call_n_params(const ir_node *node);
/** Gets the call parameter at position pos. */
FIRM_API ir_node *get_Call_param(const ir_node *node, int pos);
/** Sets the call parameter at position pos. */
......
......@@ -515,16 +515,16 @@ FIRM_API ir_initializer_t *get_entity_initializer(const ir_entity *entity);
Overwrittenby is the inverse of overwrites. Both add routines add
both relations, they only differ in the order of arguments. */
FIRM_API void add_entity_overwrites(ir_entity *ent, ir_entity *overwritten);
FIRM_API int get_entity_n_overwrites(const ir_entity *ent);
FIRM_API int get_entity_overwrites_index(const ir_entity *ent, ir_entity *overwritten);
FIRM_API ir_entity *get_entity_overwrites(const ir_entity *ent, int pos);
FIRM_API void set_entity_overwrites(ir_entity *ent, int pos, ir_entity *overwritten);
FIRM_API size_t get_entity_n_overwrites(const ir_entity *ent);
FIRM_API size_t get_entity_overwrites_index(const ir_entity *ent, ir_entity *overwritten);
FIRM_API ir_entity *get_entity_overwrites(const ir_entity *ent, size_t pos);
FIRM_API void set_entity_overwrites(ir_entity *ent, size_t pos, ir_entity *overwritten);
FIRM_API void remove_entity_overwrites(ir_entity *ent, ir_entity *overwritten);
FIRM_API int get_entity_n_overwrittenby(const ir_entity *ent);
FIRM_API int get_entity_overwrittenby_index(const ir_entity *ent, ir_entity *overwrites);
FIRM_API ir_entity *get_entity_overwrittenby(const ir_entity *ent, int pos);
FIRM_API void set_entity_overwrittenby(ir_entity *ent, int pos, ir_entity *overwrites);
FIRM_API size_t get_entity_n_overwrittenby(const ir_entity *ent);
FIRM_API size_t get_entity_overwrittenby_index(const ir_entity *ent, ir_entity *overwrites);
FIRM_API ir_entity *get_entity_overwrittenby(const ir_entity *ent, size_t pos);
FIRM_API void set_entity_overwrittenby(ir_entity *ent, size_t pos, ir_entity *overwrites);
FIRM_API void remove_entity_overwrittenby(ir_entity *ent, ir_entity *overwrites);
/**
......@@ -1380,13 +1380,13 @@ FIRM_API ident *get_class_ident(const ir_type *clss);
FIRM_API const char *get_class_name(const ir_type *clss);
/** Returns the number of members of this class. */
FIRM_API int get_class_n_members(const ir_type *clss);
FIRM_API size_t get_class_n_members(const ir_type *clss);
/** Returns the member at position pos, 0 <= pos < n_member */
FIRM_API ir_entity *get_class_member(const ir_type *clss, int pos);
FIRM_API ir_entity *get_class_member(const ir_type *clss, size_t pos);
/** Returns index of mem in clss, -1 if not contained. */
FIRM_API int get_class_member_index(const ir_type *clss, ir_entity *mem);
FIRM_API size_t get_class_member_index(const ir_type *clss, ir_entity *mem);
/** Finds the member with name 'name'. If several members with the same
* name returns one of them. Returns NULL if no member found. */
......@@ -1399,22 +1399,22 @@ FIRM_API ir_entity *get_class_member_by_name(ir_type *clss, ident *name);
FIRM_API void add_class_subtype(ir_type *clss, ir_type *subtype);
/** Returns the number of subtypes */
FIRM_API int get_class_n_subtypes(const ir_type *clss);
FIRM_API size_t get_class_n_subtypes(const ir_type *clss);
/** Gets the subtype at position pos, 0 <= pos < n_subtype. */
FIRM_API ir_type *get_class_subtype(ir_type *clss, int pos);
FIRM_API ir_type *get_class_subtype(ir_type *clss, size_t pos);
/** Returns the index to access subclass as subtype of class.
*
* If subclass is no direct subtype of class returns -1.
*/
FIRM_API int get_class_subtype_index(ir_type *clss, const ir_type *subclass);
FIRM_API size_t get_class_subtype_index(ir_type *clss, const ir_type *subclass);
/** Sets the subtype at position pos, 0 <= pos < n_subtype.
*
* Does not set the corresponding supertype relation for subtype: this might
* be a different position! */
FIRM_API void set_class_subtype(ir_type *clss, ir_type *subtype, int pos);
FIRM_API void set_class_subtype(ir_type *clss, ir_type *subtype, size_t pos);
/** Finds subtype in the list of subtypes and removes it */
FIRM_API void remove_class_subtype(ir_type *clss, ir_type *subtype);
......@@ -1434,22 +1434,22 @@ FIRM_API void remove_class_subtype(ir_type *clss, ir_type *subtype);
FIRM_API void add_class_supertype(ir_type *clss, ir_type *supertype);
/** Returns the number of supertypes */
FIRM_API int get_class_n_supertypes(const ir_type *clss);
FIRM_API size_t get_class_n_supertypes(const ir_type *clss);
/** Returns the index to access superclass as supertype of class.
*
* If superclass is no direct supertype of class returns -1.
*/
FIRM_API int get_class_supertype_index(ir_type *clss, ir_type *super_clss);
FIRM_API size_t get_class_supertype_index(ir_type *clss, ir_type *super_clss);
/** Gets the supertype at position pos, 0 <= pos < n_supertype. */
FIRM_API ir_type *get_class_supertype(ir_type *clss, int pos);
FIRM_API ir_type *get_class_supertype(ir_type *clss, size_t pos);
/** Sets the supertype at position pos, 0 <= pos < n_supertype.
*
* Does not set the corresponding subtype relation for supertype: this might
* be at a different position! */
FIRM_API void set_class_supertype(ir_type *clss, ir_type *supertype, int pos);
FIRM_API void set_class_supertype(ir_type *clss, ir_type *supertype, size_t pos);
/** Finds supertype in the list of supertypes and removes it */
FIRM_API void remove_class_supertype(ir_type *clss, ir_type *supertype);
......@@ -1525,13 +1525,13 @@ FIRM_API ident *get_struct_ident(const ir_type *strct);
FIRM_API const char *get_struct_name(const ir_type *strct);
/** Returns the number of members of this struct. */
FIRM_API int get_struct_n_members(const ir_type *strct);
FIRM_API size_t get_struct_n_members(const ir_type *strct);
/** Returns the member at position pos, 0 <= pos < n_member */
FIRM_API ir_entity *get_struct_member(const ir_type *strct, int pos);
/** Returns the member at position pos, pos < n_member */
FIRM_API ir_entity *get_struct_member(const ir_type *strct, size_t pos);
/** Returns index of member in strct, -1 if not contained. */
FIRM_API int get_struct_member_index(const ir_type *strct, ir_entity *member);
FIRM_API size_t get_struct_member_index(const ir_type *strct, ir_entity *member);
/** Returns true if a type is a struct type. */
FIRM_API int is_Struct_type(const ir_type *strct);
......@@ -1583,7 +1583,7 @@ FIRM_API int is_Struct_type(const ir_type *strct);
* The arrays for the parameter and result types are not initialized by
* the constructor.
*/
FIRM_API ir_type *new_type_method(int n_param, int n_res);
FIRM_API ir_type *new_type_method(size_t n_param, size_t n_res);
/** Create a new method type with debug information.
*
......@@ -1594,22 +1594,23 @@ FIRM_API ir_type *new_type_method(int n_param, int n_res);
* The arrays for the parameter and result types are not initialized by
* the constructor.
*/
FIRM_API ir_type *new_d_type_method(int n_param, int n_res, type_dbg_info *db);
FIRM_API ir_type *new_d_type_method(size_t n_param, size_t n_res,
type_dbg_info *db);
/* -- manipulate private fields of method. -- */
/** Returns the number of parameters of this method. */
FIRM_API int get_method_n_params(const ir_type *method);
FIRM_API size_t get_method_n_params(const ir_type *method);
/** Returns the type of the parameter at position pos of a method. */
FIRM_API ir_type *get_method_param_type(ir_type *method, int pos);
FIRM_API ir_type *get_method_param_type(ir_type *method, size_t pos);
/** Sets the type of the parameter at position pos of a method.
Also changes the type in the pass-by-value representation by just
changing the type of the corresponding entity if the representation is constructed. */
FIRM_API void set_method_param_type(ir_type *method, int pos, ir_type *tp);
FIRM_API void set_method_param_type(ir_type *method, size_t pos, ir_type *tp);
/** Returns an entity that represents the copied value argument. Only necessary
for compounds passed by value. This information is constructed only on demand. */
FIRM_API ir_entity *get_method_value_param_ent(ir_type *method, int pos);
FIRM_API ir_entity *get_method_value_param_ent(ir_type *method, size_t pos);
/**
* Sets the type that represents the copied value arguments.
*/
......@@ -1621,24 +1622,24 @@ FIRM_API void set_method_value_param_type(ir_type *method, ir_type *tp);
FIRM_API ir_type *get_method_value_param_type(const ir_type *method);
/** Returns an ident representing the parameters name. Returns NULL if not set.
For debug support only. */
FIRM_API ident *get_method_param_ident(ir_type *method, int pos);
FIRM_API ident *get_method_param_ident(ir_type *method, size_t pos);
/** Returns a string representing the parameters name. Returns NULL if not set.
For debug support only. */
FIRM_API const char *get_method_param_name(ir_type *method, int pos);
FIRM_API const char *get_method_param_name(ir_type *method, size_t pos);
/** Sets an ident representing the parameters name. For debug support only. */
FIRM_API void set_method_param_ident(ir_type *method, int pos, ident *id);
FIRM_API void set_method_param_ident(ir_type *method, size_t pos, ident *id);
/** Returns the number of results of a method type. */
FIRM_API int get_method_n_ress(const ir_type *method);
FIRM_API size_t get_method_n_ress(const ir_type *method);
/** Returns the return type of a method type at position pos. */
FIRM_API ir_type *get_method_res_type(ir_type *method, int pos);
FIRM_API ir_type *get_method_res_type(ir_type *method, size_t pos);
/** Sets the type of the result at position pos of a method.
Also changes the type in the pass-by-value representation by just
changing the type of the corresponding entity if the representation is constructed. */
FIRM_API void set_method_res_type(ir_type *method, int pos, ir_type *tp);
FIRM_API void set_method_res_type(ir_type *method, size_t pos, ir_type *tp);
/** Returns an entity that represents the copied value result. Only necessary
for compounds passed by value. This information is constructed only on demand. */
FIRM_API ir_entity *get_method_value_res_ent(ir_type *method, int pos);
FIRM_API ir_entity *get_method_value_res_ent(ir_type *method, size_t pos);
/**
* Returns a type that represents the copied value results.
......@@ -1670,7 +1671,7 @@ FIRM_API void set_method_variadicity(ir_type *method, ir_variadicity vari);
* of the method type plus one is returned for variadic functions.
* Non-variadic function types always return -1 here.
*/
FIRM_API int get_method_first_variadic_param_index(const ir_type *method);
FIRM_API size_t get_method_first_variadic_param_index(const ir_type *method);
/**
* Sets the first variadic parameter index. This allows to specify
......@@ -1678,7 +1679,8 @@ FIRM_API int get_method_first_variadic_param_index(const ir_type *method);
* but still have the knowledge, which parameter must be passed as
* variadic one.
*/
FIRM_API void set_method_first_variadic_param_index(ir_type *method, int index);
FIRM_API void set_method_first_variadic_param_index(ir_type *method,
size_t index);
/** Returns the mask of the additional graph properties. */
FIRM_API mtp_additional_properties get_method_additional_properties(const ir_type *method);
......@@ -1796,13 +1798,13 @@ FIRM_API ident *get_union_ident(const ir_type *uni);
FIRM_API const char *get_union_name(const ir_type *uni);
/** Returns the number of unioned types of this union */
FIRM_API int get_union_n_members(const ir_type *uni);
FIRM_API size_t get_union_n_members(const ir_type *uni);
/** Returns the entity at position pos of a union */
FIRM_API ir_entity *get_union_member(const ir_type *uni, int pos);
FIRM_API ir_entity *get_union_member(const ir_type *uni, size_t pos);
/** Returns index of member in uni, -1 if not contained. */
FIRM_API int get_union_member_index(const ir_type *uni, ir_entity *member);
FIRM_API size_t get_union_member_index(const ir_type *uni, ir_entity *member);
/** Returns true if a type is a union type. */
FIRM_API int is_Union_type(const ir_type *uni);
......@@ -1845,59 +1847,59 @@ FIRM_API ir_type *new_d_type_array(int n_dims, ir_type *element_type,
/* --- manipulate private fields of array type --- */
/** Returns the number of array dimensions of this type. */
FIRM_API int get_array_n_dimensions(const ir_type *array);
FIRM_API size_t get_array_n_dimensions(const ir_type *array);
/**
* Allocates Const nodes of mode_Is for one array dimension.
* Upper bound in Firm is the element next to the last, i.e. [lower,upper[
*/
FIRM_API void set_array_bounds_int(ir_type *array, int dimension,
FIRM_API void set_array_bounds_int(ir_type *array, size_t dimension,
int lower_bound, int upper_bound);
/**
* Sets the bounds for one array dimension.
* Upper bound in Firm is the element next to the last, i.e. [lower,upper[
*/
FIRM_API void set_array_bounds(ir_type *array, int dimension,
FIRM_API void set_array_bounds(ir_type *array, size_t dimension,
ir_node *lower_bound, ir_node *upper_bound);
/** Sets the lower bound for one array dimension, i.e. [lower,upper[ */
FIRM_API void set_array_lower_bound(ir_type *array, int dimension,
FIRM_API void set_array_lower_bound(ir_type *array, size_t dimension,
ir_node *lower_bound);
/** Allocates Const nodes of mode_Is for the lower bound of an array
dimension, i.e. [lower,upper[ */
FIRM_API void set_array_lower_bound_int(ir_type *array, int dimension,
FIRM_API void set_array_lower_bound_int(ir_type *array, size_t dimension,
int lower_bound);
/** Sets the upper bound for one array dimension, i.e. [lower,upper[ */
FIRM_API void set_array_upper_bound(ir_type *array, int dimension,
FIRM_API void set_array_upper_bound(ir_type *array, size_t dimension,
ir_node *upper_bound);
/** Allocates Const nodes of mode_Is for the upper bound of an array
dimension, i.e. [lower,upper[. */
FIRM_API void set_array_upper_bound_int(ir_type *array, int dimension,
FIRM_API void set_array_upper_bound_int(ir_type *array, size_t dimension,
int upper_bound);
/** Returns true if lower bound != Unknown. */
FIRM_API int has_array_lower_bound(const ir_type *array, int dimension);
FIRM_API int has_array_lower_bound(const ir_type *array, size_t dimension);
/** Returns the lower bound of an array. */
FIRM_API ir_node *get_array_lower_bound(const ir_type *array, int dimension);
FIRM_API ir_node *get_array_lower_bound(const ir_type *array, size_t dimension);
/** Works only if bound is Const node with tarval that can be converted to long. */
FIRM_API long get_array_lower_bound_int(const ir_type *array, int dimension);
FIRM_API long get_array_lower_bound_int(const ir_type *array, size_t dimension);
/** returns true if lower bound != Unknown */
FIRM_API int has_array_upper_bound(const ir_type *array, int dimension);
FIRM_API int has_array_upper_bound(const ir_type *array, size_t dimension);
/** Returns the upper bound of an array. */
FIRM_API ir_node *get_array_upper_bound(const ir_type *array, int dimension);
FIRM_API ir_node *get_array_upper_bound(const ir_type *array, size_t dimension);
/** Works only if bound is Const node with tarval that can be converted to long. */
FIRM_API long get_array_upper_bound_int(const ir_type *array, int dimension);
FIRM_API long get_array_upper_bound_int(const ir_type *array, size_t dimension);
/** Sets an array dimension to a specific order. */
FIRM_API void set_array_order(ir_type *array, int dimension, int order);
FIRM_API void set_array_order(ir_type *array, size_t dimension, int order);
/** Returns the order of an array dimension. */
FIRM_API int get_array_order(const ir_type *array, int dimension);
FIRM_API int get_array_order(const ir_type *array, size_t dimension);
/** Find the array dimension that is placed at order order. */
FIRM_API int find_array_dimension(const ir_type *array, int order);
FIRM_API size_t find_array_dimension(const ir_type *array, int order);
/** Sets the array element type. */
FIRM_API void set_array_element_type(ir_type *array, ir_type* tp);
......@@ -1928,10 +1930,10 @@ FIRM_API int is_Array_type(const ir_type *array);
*/
/** Create a new type enumeration -- set the enumerators independently. */
FIRM_API ir_type *new_type_enumeration(ident *name, int n_enums);
FIRM_API ir_type *new_type_enumeration(ident *name, size_t n_enums);
/** Create a new type enumeration with debug information -- set the enumerators independently. */
FIRM_API ir_type *new_d_type_enumeration(ident *name, int n_enums,
FIRM_API ir_type *new_d_type_enumeration(ident *name, size_t n_enums,
type_dbg_info *db);
/* --- manipulate fields of enumeration type. --- */
......@@ -1943,15 +1945,15 @@ FIRM_API ident *get_enumeration_ident(const ir_type *enumeration);
FIRM_API const char *get_enumeration_name(const ir_type *enumeration);
/** Set an enumeration constant to a enumeration type at a given position. */
FIRM_API void set_enumeration_const(ir_type *enumeration, int pos,
FIRM_API void set_enumeration_const(ir_type *enumeration, size_t pos,
ident *nameid, ir_tarval *con);
/** Returns the number of enumeration values of this enumeration */
FIRM_API int get_enumeration_n_enums(const ir_type *enumeration);
FIRM_API size_t get_enumeration_n_enums(const ir_type *enumeration);
/** Returns the enumeration constant at a given position. */
FIRM_API ir_enum_const *get_enumeration_const(const ir_type *enumeration,
int pos);
size_t pos);
/** Returns the enumeration type owner of an enumeration constant. */
FIRM_API ir_type *get_enumeration_owner(const ir_enum_const *enum_cnst);
......@@ -2105,7 +2107,7 @@ FIRM_API const char *get_compound_name(const ir_type *tp);
*
* @return Number of members in the compound type.
*/
FIRM_API int get_compound_n_members(const ir_type *tp);
FIRM_API size_t get_compound_n_members(const ir_type *tp);
/**
* Gets the member of a Firm compound type at position pos.
......@@ -2115,10 +2117,10 @@ FIRM_API int get_compound_n_members(const ir_type *tp);
*
* @return The member entity at position pos.
*/
FIRM_API ir_entity *get_compound_member(const ir_type *tp, int pos);
FIRM_API ir_entity *get_compound_member(const ir_type *tp, size_t pos);
/** Returns index of member in tp, -1 if not contained. */
FIRM_API int get_compound_member_index(const ir_type *tp, ir_entity *member);
FIRM_API size_t get_compound_member_index(const ir_type *tp, ir_entity *member);
/**
* layout members of a struct/union or class type in a default way.
......
......@@ -278,13 +278,13 @@ void analyze_irg_args(ir_graph *irg)
* Compute for a method with pointer parameter(s)
* if they will be read or written.
*/
ptr_access_kind get_method_param_access(ir_entity *ent, int pos)
ptr_access_kind get_method_param_access(ir_entity *ent, size_t pos)
{
#ifndef NDEBUG
ir_type *mtp = get_entity_type(ent);
int is_variadic = get_method_variadicity(mtp) == variadicity_variadic;
assert(0 <= pos && (is_variadic || pos < get_method_n_params(mtp)));
assert(is_variadic || pos < get_method_n_params(mtp));
#endif
if (ent->attr.mtd_attr.param_access) {
......@@ -472,7 +472,7 @@ static void analyze_method_params_weight(ir_entity *ent)
* @return the parameter weight or null_weight if pos is greater
* than the number of arguments.
*/
unsigned get_method_param_weight(ir_entity *ent, int pos)
unsigned get_method_param_weight(ir_entity *ent, size_t pos)
{
if (ent->attr.mtd_attr.param_weight) {
if (pos < ARR_LEN(ent->attr.mtd_attr.param_weight))
......
......@@ -1736,7 +1736,7 @@ static ir_node *gen_Start(ir_node *node)
ir_node *incsp;
ir_node *sp;
ir_node *barrier;
int i;
size_t i;
/* stackpointer is important at function prolog */
be_prolog_add_reg(abihelper, sp_reg,
......@@ -1750,7 +1750,7 @@ static ir_node *gen_Start(ir_node *node)
be_prolog_add_reg(abihelper, param->reg1, arch_register_req_type_none);
}
/* announce that we need the values of the callee save regs */
for (i = 0; i < (int) (sizeof(callee_saves)/sizeof(callee_saves[0])); ++i) {
for (i = 0; i < (sizeof(callee_saves)/sizeof(callee_saves[0])); ++i) {
be_prolog_add_reg(abihelper, callee_saves[i], arch_register_req_type_none);
}
......@@ -1854,8 +1854,8 @@ static ir_node *gen_Call(ir_node *node)
dbg_info *dbgi = get_irn_dbg_info(node);
ir_type *type = get_Call_type(node);
calling_convention_t *cconv = arm_decide_calling_convention(NULL, type);
int n_params = get_Call_n_params(node);
int n_param_regs = sizeof(param_regs)/sizeof(param_regs[0]);
size_t n_params = get_Call_n_params(node);
size_t n_param_regs = sizeof(param_regs)/sizeof(param_regs[0]);
/* max inputs: memory, callee, register arguments */
int max_inputs = 2 + n_param_regs;
ir_node **in = ALLOCAN(ir_node*, max_inputs);
......@@ -1871,7 +1871,7 @@ static ir_node *gen_Call(ir_node *node)
ir_node *incsp = NULL;
int mem_pos;
ir_node *res;
int p;
size_t p;
int o;
int out_arity;
......
......@@ -336,7 +336,7 @@ static ir_node *adjust_call(be_abi_irg_t *env, ir_node *irn, ir_node *curr_sp)
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;
......@@ -364,6 +364,7 @@ static ir_node *adjust_call(be_abi_irg_t *env, ir_node *irn, ir_node *curr_sp)
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. */
......@@ -372,26 +373,26 @@ static ir_node *adjust_call(be_abi_irg_t *env, ir_node *irn, ir_node *curr_sp)
/* 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;
}
}
......
......@@ -175,7 +175,7 @@ const arch_register_class_t *arch_get_irn_reg_class(const ir_node *irn, int pos)
static inline reg_out_info_t *get_out_info(const ir_node *node)
{
int pos = 0;
size_t pos = 0;
const backend_info_t *info;
assert(get_irn_mode(node) != mode_T);
......@@ -185,7 +185,7 @@ static inline reg_out_info_t *get_out_info(const ir_node *node)
}
info = be_get_info(node);
assert(pos >= 0 && pos < ARR_LEN(info->out_infos));
assert(pos < ARR_LEN(info->out_infos));
return &info->out_infos[pos];
}
......@@ -194,7 +194,7 @@ static inline reg_out_info_t *get_out_info_n(const ir_node *node, int pos)
{
const backend_info_t *info = be_get_info(node);
assert(!is_Proj(node));
assert(pos >= 0 && pos < ARR_LEN(info->out_infos));
assert(pos >= 0 && pos < (int)ARR_LEN(info->out_infos));
return &info->out_infos[pos];
}
......
......@@ -1301,7 +1301,7 @@ static ir_node *gen_Start(ir_node *node)
ir_node *start;
ir_node *sp;
ir_node *barrier;
int i;
size_t i;
/* stackpointer is important at function prolog */
be_prolog_add_reg(abihelper, sp_reg,
......@@ -1387,9 +1387,9 @@ static ir_node *gen_Return(ir_node *node)
ir_node *mem = get_Return_mem(node);
ir_node *new_mem = be_transform_node(mem);
ir_node *sp = get_stack_pointer_for(node);
int n_res = get_Return_n_ress(node);
size_t n_res = get_Return_n_ress(node);
ir_node *bereturn;
int i;
size_t i;
be_epilog_begin(abihelper);
be_epilog_set_memory(abihelper, new_mem);
......@@ -1515,8 +1515,8 @@ static ir_node *gen_Call(ir_node *node)
ir_node *new_mem = be_transform_node(mem);
dbg_info *dbgi = get_irn_dbg_info(node);
ir_type *type = get_Call_type(node);
int n_params = get_Call_n_params(node);
int n_param_regs = sizeof(param_regs)/sizeof(param_regs[0]);
size_t n_params = get_Call_n_params(node);
size_t n_param_regs = sizeof(param_regs)/sizeof(param_regs[0]);
/* max inputs: memory, callee, register arguments */
int max_inputs = 2 + n_param_regs;
ir_node **in = ALLOCAN(ir_node*, max_inputs);
......@@ -1535,7 +1535,7 @@ static ir_node *gen_Call(ir_node *node)
ir_node *incsp;
int mem_pos;
ir_node *res;
int p;
size_t p;
int i;
int o;
int out_arity;
......
......@@ -2032,8 +2032,9 @@ static void dump_out_edge(ir_node *n, void *env)
static void dump_loop_label(FILE *F, ir_loop *loop)
{
fprintf(F, "loop %d, %d sons, %d nodes",
get_loop_depth(loop), get_loop_n_sons(loop), get_loop_n_nodes(loop));
fprintf(F, "loop %u, %lu sons, %lu nodes",
get_loop_depth(loop), (unsigned long) get_loop_n_sons(loop),
(unsigned long) get_loop_n_nodes(loop));
}
static void dump_loop_info(FILE *F, ir_loop *loop)
......@@ -2041,7 +2042,7 @@ static void dump_loop_info(FILE *F, ir_loop *loop)
fprintf(F, " info1: \"");
fprintf(F, " loop nr: %ld", get_loop_loop_nr(loop));
#ifdef DEBUG_libfirm /* GL @@@ debug analyses */
fprintf(F, "\n The loop was analyzed %d times.", PTR_TO_INT(get_loop_link(loop)));
fprintf(F, "\n The loop was analyzed %ld times.", (long int) PTR_TO_INT(get_loop_link(loop)));
#endif
fprintf(F, "\"");
}
......@@ -2075,8 +2076,8 @@ static void dump_loop_son_edge(FILE *F, ir_loop *loop, int i)
PRINT_LOOPID(loop);
fprintf(F, "\" targetname: \"");
PRINT_LOOPID(get_loop_son(loop, i));
fprintf(F, "\" color: darkgreen label: \"%d\"}\n",
get_loop_element_pos(loop, get_loop_son(loop, i)));
fprintf(F, "\" color: darkgreen label: \"%lu\"}\n",
(unsigned long) get_loop_element_pos(loop, get_loop_son(loop, i)));
}
static void dump_loops(FILE *F, ir_loop *loop)
......@@ -2465,7 +2466,9 @@ void dump_class_hierarchy(FILE *out)
static void dump_loops_standalone(FILE *F, ir_loop *loop)
{
size_t i;
int loop_node_started = 0, son_number = 0, first = 0;
bool loop_node_started = false;