X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firvrfy.c;h=0a4e8d4a02fb1c481c8f411e45c12b60f081623d;hb=af0115376ccdcc72e0643caf221407218f4504f0;hp=57d5a283a8f666be394ca805e73418031f67b908;hpb=4b1138a9eee25ce11adbb7d7162eaa49421e8b51;p=libfirm diff --git a/ir/ir/irvrfy.c b/ir/ir/irvrfy.c index 57d5a283a..0a4e8d4a0 100644 --- a/ir/ir/irvrfy.c +++ b/ir/ir/irvrfy.c @@ -23,9 +23,7 @@ * @author Christian Schaefer, Goetz Lindenmaier, Till Riedel, Michael Beck * @version $Id$ */ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "config.h" #include "irprog.h" #include "irop_t.h" @@ -60,11 +58,13 @@ static const char *get_mode_name_ex(ir_mode *mode) { return get_mode_name(mode); } -/** the last IRG, on which a verify error was found */ +/** the last IRG, on which a verification error was found */ static ir_graph *last_irg_error = NULL; /** * print the name of the entity of an verification failure + * + * @param node the node caused the failure */ static void show_entity_failure(ir_node *node) { ir_graph *irg = get_irn_irg(node); @@ -305,9 +305,7 @@ static int verify_node_Proj_Start(ir_node *n, ir_node *p) { (proj == pn_Start_M && mode == mode_M) || (proj == pn_Start_P_frame_base && mode_is_reference(mode)) || (proj == pn_Start_P_tls && mode_is_reference(mode)) || - (proj == pn_Start_T_args && mode == mode_T) || - (proj == pn_Start_P_value_arg_base && mode_is_reference(mode)) || - (proj == pn_Start_P_value_arg_base && mode == mode_T) /* FIXME: only one of those */ + (proj == pn_Start_T_args && mode == mode_T) ), "wrong Proj from Start", 0, show_proj_failure(p); @@ -690,15 +688,6 @@ static int verify_node_Proj_Proj(ir_node *pred, ir_node *p) { show_proj_mode_failure(p, get_method_param_type(mt, proj)); ); } - } else if (nr == pn_Start_P_value_arg_base) { - ASSERT_AND_RET( - (proj >= 0 && mode_is_reference(mode)), - "wrong Proj from Proj from Start", 0 - ); - ASSERT_AND_RET( - (proj < get_method_n_params(mt)), - "More Projs for args than args in type", 0 - ); } break; @@ -1612,9 +1601,9 @@ static int verify_node_Phi(ir_node *n, ir_graph *irg) { } /* Phi: BB x dataM^n --> dataM */ - for (i = get_irn_arity(n) - 1; i >= 0; --i) { - ir_node *pred = get_irn_n(n, i); - if (!is_Bad(pred) && !is_Unknown(pred)) { + for (i = get_Phi_n_preds(n) - 1; i >= 0; --i) { + ir_node *pred = get_Phi_pred(n, i); + if (!is_Bad(pred)) { ASSERT_AND_RET_DBG( get_irn_mode(pred) == mymode, "Phi node", 0, @@ -1677,9 +1666,6 @@ static int verify_node_Load(ir_node *n, ir_graph *irg) { ASSERT_AND_RET(op1mode == mode_M, "Load node", 0); if (get_irg_phase_state(irg) != phase_backend) { ASSERT_AND_RET(mode_is_reference(op2mode), "Load node", 0 ); - } else { - ASSERT_AND_RET(mode_is_reference(op2mode) || - (mode_is_int(op2mode) && get_mode_size_bits(op2mode) == get_mode_size_bits(mode_P)), "Load node", 0 ); } ASSERT_AND_RET( mymode == mode_T, "Load node", 0 ); @@ -1715,9 +1701,6 @@ static int verify_node_Store(ir_node *n, ir_graph *irg) { ASSERT_AND_RET(op1mode == mode_M && mode_is_datab(op3mode), "Store node", 0 ); if (get_irg_phase_state(irg) != phase_backend) { ASSERT_AND_RET(mode_is_reference(op2mode), "Store node", 0 ); - } else { - ASSERT_AND_RET(mode_is_reference(op2mode) || - (mode_is_int(op2mode) && get_mode_size_bits(op2mode) == get_mode_size_bits(mode_P)), "Store node", 0 ); } ASSERT_AND_RET(mymode == mode_T, "Store node", 0); @@ -1849,11 +1832,6 @@ static int verify_node_CopyB(ir_node *n, ir_graph *irg) { if (get_irg_phase_state(irg) != phase_backend) { ASSERT_AND_RET(mode_is_reference(op2mode) && mode_is_reference(op3mode), "CopyB node", 0 ); - } else { - ASSERT_AND_RET(mode_is_reference(op2mode) || - (mode_is_int(op2mode) && get_mode_size_bits(op2mode) == get_mode_size_bits(mode_P)), "CopyB node", 0 ); - ASSERT_AND_RET(mode_is_reference(op3mode) || - (mode_is_int(op3mode) && get_mode_size_bits(op3mode) == get_mode_size_bits(mode_P)), "CopyB node", 0 ); } ASSERT_AND_RET( @@ -1963,7 +1941,8 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg) { { unsigned idx = get_irn_idx(n); ir_node *node_from_map = get_idx_irn(irg, idx); - ASSERT_AND_RET_DBG(node_from_map == n, "Node index and index map entry differ", 0, ir_printf("node %+F node in map %+F(%p)", n, node_from_map, node_from_map)); + ASSERT_AND_RET_DBG(node_from_map == n, "Node index and index map entry differ", 0, + ir_printf("node %+F node in map %+F(%p)\n", n, node_from_map, node_from_map)); } }