}
}
+static const char *get_irn_modename(const ir_node *node)
+{
+ ir_mode *mode = get_irn_mode(node);
+ return get_mode_name(mode);
+}
+
/**
* Prints a failure for a Node
*/
*/
static void show_call_param(ir_node *n, ir_type *mt)
{
- int i;
+ size_t i;
char type_name[256];
ir_print_type(type_name, sizeof(type_name), mt);
ir_entity *ent = get_irg_entity(irg);
show_entity_failure(n);
- fprintf(stderr, " Return node %ld in entity \"%s\" has %d results different from type %d\n",
+ fprintf(stderr, " Return node %ld in entity \"%s\" has %lu results different from type %lu\n",
get_irn_node_nr(n), get_entity_name(ent),
- get_Return_n_ress(n), get_method_n_ress(mt));
+ (unsigned long) get_Return_n_ress(n),
+ (unsigned long) get_method_n_ress(mt));
}
/**
return 1;
}
-/**
- * verify a Proj(DivMod) node
- */
-static int verify_node_Proj_DivMod(ir_node *n, ir_node *p)
-{
- ir_mode *mode = get_irn_mode(p);
- long proj = get_Proj_proj(p);
-
- ASSERT_AND_RET_DBG(
- (
- (proj == pn_DivMod_M && mode == mode_M) ||
- (proj == pn_DivMod_X_regular && mode == mode_X) ||
- (proj == pn_DivMod_X_except && mode == mode_X) ||
- (proj == pn_DivMod_res_div && mode_is_int(mode) && mode == get_DivMod_resmode(n)) ||
- (proj == pn_DivMod_res_mod && mode_is_int(mode) && mode == get_DivMod_resmode(n))
- ),
- "wrong Proj from DivMod", 0,
- show_proj_failure(p);
- );
- if (proj == pn_DivMod_X_regular)
- ASSERT_AND_RET(
- get_irn_pinned(n) == op_pin_state_pinned,
- "Regular Proj from unpinned DivMod", 0);
- else if (proj == pn_DivMod_X_except)
- ASSERT_AND_RET(
- get_irn_pinned(n) == op_pin_state_pinned,
- "Exception Proj from unpinned DivMod", 0);
- else if (proj == pn_DivMod_M)
- ASSERT_AND_RET(
- get_irn_pinned(n) == op_pin_state_pinned,
- "Memory Proj from unpinned DivMod", 0);
- return 1;
-}
-
/**
* verify a Proj(Div) node
*/
);
ASSERT_AND_RET_DBG(
(mode_is_float(get_irn_mode(get_Cmp_left(n))) || !(proj & pn_Cmp_Uo)),
- "unordered Proj for non-float Cmp", 0,
+ "unordered Proj for non-float Cmp (Did you use Ne instead of Lg?)", 0,
show_proj_failure(p);
);
return 1;
(proj >= 0 && mode_is_datab(mode)),
"wrong Proj from Proj from Start", 0);
ASSERT_AND_RET(
- (proj < get_method_n_params(mt)),
+ (proj < (int)get_method_n_params(mt)),
"More Projs for args than args in type", 0
);
if ((mode_is_reference(mode)) && is_compound_type(get_method_param_type(mt, proj)))
ASSERT_AND_RET(mt == get_unknown_type() || is_Method_type(mt),
"wrong call type on call", 0);
ASSERT_AND_RET(
- (proj < get_method_n_ress(mt)),
+ (proj < (int)get_method_n_ress(mt)),
"More Projs for results than results in type.", 0);
if ((mode_is_reference(mode)) && is_compound_type(get_method_res_type(mt, proj)))
/* value result */ break;
ASSERT_AND_RET( mymode == mode_X, "Result X", 0 ); /* result X */
/* Compare returned results with result types of method type */
mt = get_entity_type(get_irg_entity(irg));
- ASSERT_AND_RET_DBG( get_Return_n_ress(n) == get_method_n_ress(mt),
+ ASSERT_AND_RET_DBG(get_Return_n_ress(n) == get_method_n_ress(mt),
"Number of results for Return doesn't match number of results in type.", 0,
show_return_nres(irg, n, mt););
for (i = get_Return_n_ress(n) - 1; i >= 0; --i) {
ir_mode *op1mode = get_irn_mode(get_Call_mem(n));
ir_mode *op2mode = get_irn_mode(get_Call_ptr(n));
ir_type *mt;
- int i;
+ size_t i;
+ size_t n_params;
(void) irg;
/* Call: BB x M x ref x data1 x ... x datan
return 1;
}
- for (i = get_Call_n_params(n) - 1; i >= 0; --i) {
+ n_params = get_Call_n_params(n);
+ for (i = 0; i < n_params; ++i) {
ASSERT_AND_RET( mode_is_datab(get_irn_mode(get_Call_param(n, i))), "Call node", 0 ); /* operand datai */
}
return 1;
}
-/**
- * verify a DivMod node
- */
-static int verify_node_DivMod(ir_node *n, ir_graph *irg)
-{
- ir_mode *mymode = get_irn_mode(n);
- ir_mode *op1mode = get_irn_mode(get_DivMod_mem(n));
- ir_mode *op2mode = get_irn_mode(get_DivMod_left(n));
- ir_mode *op3mode = get_irn_mode(get_DivMod_right(n));
- (void) irg;
-
- ASSERT_AND_RET(
- /* DivMod: BB x M x int x int --> M x X x int x int */
- op1mode == mode_M &&
- mode_is_int(op2mode) &&
- op3mode == op2mode &&
- mymode == mode_T,
- "DivMod node", 0
- );
- return 1;
-}
-
/**
* verify a Div node
*/
CASE(Mul);
CASE(Mulh);
CASE(Quot);
- CASE(DivMod);
CASE(Div);
CASE(Mod);
CASE(And);
CASE(InstOf);
CASE(Call);
CASE(Quot);
- CASE(DivMod);
CASE(Div);
CASE(Mod);
CASE(Cmp);