/** Returns parameter inputs of Call node @p node as array. */
FIRM_API ir_node **get_Call_param_arr(ir_node *node);
/** Returns the number of parameters of a call. */
-FIRM_API size_t get_Call_n_params(const ir_node *node);
+FIRM_API int get_Call_n_params(const ir_node *node);
/** Returns 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. */
arch_env_get_call_abi(arch_env, call_tp, call);
/* Insert code to put the stack arguments on the stack. */
- assert(get_Call_n_params(irn) == n_params);
+ assert((size_t)get_Call_n_params(irn) == n_params);
stack_param_idx = ALLOCAN(int, n_params);
for (p = 0; p < n_params; ++p) {
be_abi_call_arg_t *arg = get_call_arg(call, 0, p, 0);
return &get_irn_in(node)[CALL_PARAM_OFFSET + 1];
}
-size_t get_Call_n_params(const ir_node *node)
+int get_Call_n_params(const ir_node *node)
{
assert(is_Call(node));
- return (size_t) (get_irn_arity(node) - CALL_PARAM_OFFSET);
+ return get_irn_arity(node) - CALL_PARAM_OFFSET;
}
ir_node *get_Call_param(const ir_node *node, int pos)
*/
static void show_call_param(const ir_node *n, ir_type *mt)
{
- size_t i;
char type_name[256];
ir_print_type(type_name, sizeof(type_name), mt);
show_entity_failure(n);
fprintf(stderr, " Call type-check failed: %s(", type_name);
- for (i = 0; i < get_method_n_params(mt); ++i) {
+ size_t n_method_params = get_method_n_params(mt);
+ for (size_t i = 0; i < n_method_params; ++i) {
fprintf(stderr, "%s ", get_mode_name_ex(get_type_mode(get_method_param_type(mt, i))));
}
fprintf(stderr, ") != CALL(");
- for (i = 0; i < get_Call_n_params(n); ++i) {
+ int n_params = get_Call_n_params(n);
+ for (int i = 0; i < n_params; ++i) {
fprintf(stderr, "%s ", get_mode_name_ex(get_irn_mode(get_Call_param(n, i))));
}
fprintf(stderr, ")\n");
if (get_method_variadicity(mt) == variadicity_variadic) {
ASSERT_AND_RET_DBG(
- get_Call_n_params(n) >= get_method_n_params(mt),
+ (size_t)get_Call_n_params(n) >= get_method_n_params(mt),
"Number of args for Call doesn't match number of args in variadic type.",
0,
ir_fprintf(stderr, "Call %+F has %d params, type %d\n",
);
} else {
ASSERT_AND_RET_DBG(
- get_Call_n_params(n) == get_method_n_params(mt),
+ (size_t)get_Call_n_params(n) == get_method_n_params(mt),
"Number of args for Call doesn't match number of args in non variadic type.",
0,
ir_fprintf(stderr, "Call %+F has %d params, type %d\n",