/*
- * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved.
+ * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
#endif /* #ifndef NDEBUG */
-/** If the address is Sel or SymConst, return the entity. */
+/**
+ * If the address is Sel or SymConst, return the entity.
+ *
+ * @param ptr the node representing the address
+ */
static ir_entity *get_ptr_entity(ir_node *ptr) {
if (get_irn_op(ptr) == op_Sel) {
return get_Sel_entity(ptr);
- } else if ((get_irn_op(ptr) == op_SymConst) && (get_SymConst_kind(ptr) == symconst_addr_ent)) {
+ } else if (is_SymConst_addr_ent(ptr)) {
return get_SymConst_entity(ptr);
}
return NULL;
"wrong Proj from Call", 0,
show_proj_failure(p);
);
+ /* if we have exception flow, we must have a real Memory input */
if (proj == pn_Call_X_regular)
ASSERT_AND_RET(
get_irn_op(get_Call_mem(n)) != op_NoMem,
"wrong Proj from Cmp", 0,
show_proj_failure(p);
);
+ 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,
+ show_proj_failure(p);
+ );
return 1;
}
*/
static int verify_node_Block(ir_node *n, ir_graph *irg) {
int i;
- ir_node *mb = get_irn_n(n, -1);
+ ir_node *mb = get_Block_MacroBlock(n);
- if (mb != n) {
- /* must be a partBlock */
- ASSERT_AND_RET(mb != NULL && (is_Block(mb) || is_Bad(mb)), "wrong MacroBlock header", 0);
+ ASSERT_AND_RET(is_Block(mb) || is_Bad(mb), "Block node with wrong MacroBlock", 0);
+
+ if (is_Block(mb) && mb != n) {
+ /* Blocks with more than one predecessor must be header blocks */
ASSERT_AND_RET(get_Block_n_cfgpreds(n) == 1, "partBlock with more than one predecessor", 0);
}
+
for (i = get_Block_n_cfgpreds(n) - 1; i >= 0; --i) {
ir_node *pred = get_Block_cfgpred(n, i);
ASSERT_AND_RET(
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,
- fprintf(stderr, "Call has %d params, method %s type %d\n",
- get_Call_n_params(n), get_type_name(mt), get_method_n_params(mt));
+ ir_fprintf(stderr, "Call %+F has %d params, method %s type %d\n",
+ n, get_Call_n_params(n), get_type_name(mt), get_method_n_params(mt));
);
} else {
- ASSERT_AND_RET(
+ ASSERT_AND_RET_DBG(
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);
+ 0,
+ ir_fprintf(stderr, "Call %+F has %d params, method %s type %d\n",
+ n, get_Call_n_params(n), get_type_name(mt), get_method_n_params(mt));
+ );
}
for (i = 0; i < get_method_n_params(mt); i++) {
fprintf(stderr, "irg_vrfy_bads: Block %ld has Bad predecessor\n", get_irn_node_nr(node));
}
if (get_node_verification_mode() == FIRM_VERIFICATION_ON) {
- dump_ir_block_graph(current_ir_graph, "-assert");
+ dump_ir_block_graph_sched(current_ir_graph, "-assert");
assert(0 && "Bad CF detected");
}
}
fprintf(stderr, "irg_vrfy_bads: node %ld has Bad Block\n", get_irn_node_nr(node));
}
if (get_node_verification_mode() == FIRM_VERIFICATION_ON) {
- dump_ir_block_graph(current_ir_graph, "-assert");
+ dump_ir_block_graph_sched(current_ir_graph, "-assert");
assert(0 && "Bad CF detected");
}
}
fprintf(stderr, "irg_vrfy_bads: node %ld is a Tuple\n", get_irn_node_nr(node));
}
if (get_node_verification_mode() == FIRM_VERIFICATION_ON) {
- dump_ir_block_graph(current_ir_graph, "-assert");
+ dump_ir_block_graph_sched(current_ir_graph, "-assert");
assert(0 && "Tuple detected");
}
}
fprintf(stderr, "irg_vrfy_bads: Phi %ld has Bad Input\n", get_irn_node_nr(node));
}
if (get_node_verification_mode() == FIRM_VERIFICATION_ON) {
- dump_ir_block_graph(current_ir_graph, "-assert");
+ dump_ir_block_graph_sched(current_ir_graph, "-assert");
assert(0 && "Bad CF detected");
}
}
fprintf(stderr, "irg_vrfy_bads: node %ld has Bad Input\n", get_irn_node_nr(node));
}
if (get_node_verification_mode() == FIRM_VERIFICATION_ON) {
- dump_ir_block_graph(current_ir_graph, "-assert");
+ dump_ir_block_graph_sched(current_ir_graph, "-assert");
assert(0 && "Bad NON-CF detected");
}
}