From 19975388facbb3943fbc2aa2f5f9422350bb5cb3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=B6tz=20Lindenmaier?= Date: Thu, 24 Jun 2004 06:43:41 +0000 Subject: [PATCH] phase handling [r3199] --- ir/ir/irgopt.c | 8 ++++---- ir/ir/irprog.c | 2 +- ir/ir/irvrfy.c | 28 ++++++++-------------------- 3 files changed, 13 insertions(+), 25 deletions(-) diff --git a/ir/ir/irgopt.c b/ir/ir/irgopt.c index 6b13921f4..06706f58d 100644 --- a/ir/ir/irgopt.c +++ b/ir/ir/irgopt.c @@ -35,6 +35,7 @@ # include "irbackedge_t.h" # include "irflag_t.h" # include "firmstat.h" +# include "cgana.h" /* Defined in iropt.c */ pset *new_identities (void); @@ -453,9 +454,8 @@ dead_node_elimination(ir_graph *irg) { /* Handle graph state */ assert(get_irg_phase_state(current_ir_graph) != phase_building); - assert(get_irg_callee_info_state(current_ir_graph) == irg_callee_info_none); + free_callee_info(current_ir_graph); free_outs(current_ir_graph); - /* @@@ so far we loose loops when copying */ free_loop_information(current_ir_graph); @@ -1094,7 +1094,7 @@ void inline_small_irgs(ir_graph *irg, int size) { current_ir_graph = irg; /* Handle graph state */ assert(get_irg_phase_state(current_ir_graph) != phase_building); - assert(get_irg_callee_info_state(current_ir_graph) == irg_callee_info_none); + free_callee_info(current_ir_graph); /* Find Call nodes to inline. (We can not inline during a walk of the graph, as inlineing the same @@ -1211,7 +1211,7 @@ void inline_leave_functions(int maxsize, int leavesize, int size) { for (i = 0; i < n_irgs; ++i) { current_ir_graph = get_irp_irg(i); assert(get_irg_phase_state(current_ir_graph) != phase_building); - assert(get_irg_callee_info_state(current_ir_graph) == irg_callee_info_none); + free_callee_info(current_ir_graph); irg_walk(get_irg_end(current_ir_graph), NULL, collect_calls2, get_irg_link(current_ir_graph)); diff --git a/ir/ir/irprog.c b/ir/ir/irprog.c index 797fd22b3..0200998a1 100644 --- a/ir/ir/irprog.c +++ b/ir/ir/irprog.c @@ -58,7 +58,7 @@ ir_prog *new_ir_prog (void) { /* res->obst = (struct obstack *) xmalloc (sizeof (struct obstack)); */ res->graphs = NEW_ARR_F (ir_graph *, 1); res->types = NEW_ARR_F (type *, 1); - res->name = NULL; + res->name = new_id_from_str("no_name_set"); #ifdef DEBUG_libfirm res->max_node_nr = 0; diff --git a/ir/ir/irvrfy.c b/ir/ir/irvrfy.c index 12104b66a..a62e6ce3e 100644 --- a/ir/ir/irvrfy.c +++ b/ir/ir/irvrfy.c @@ -14,6 +14,7 @@ # include #endif +# include "irprog.h" # include "irgraph_t.h" # include "irvrfy.h" # include "irgwalk.h" @@ -64,24 +65,6 @@ ir_node **get_irn_in(ir_node *node); static node_verification_t opt_do_node_verification = NODE_VERIFICATION_ON; static const char *bad_msg; - -/** Borrowed from interprete.c -static entity *hunt_for_entity (ir_node *addr, ir_node *load) { - ir_op *op = get_irn_op(addr); - if (op == op_Sel) - return get_Sel_entity(addr); - if (op == op_Const) { - tarval *tv = get_Const_tarval(addr); - assert(tarval_is_entity(tv)); - return get_tarval_entity(tv); - } - - if(get_irn_opcode(load) == iro_Load) - return(NULL); - assert(0 && "unexpected address expression."); - return NULL; -} -*/ /** * little helper for NULL modes */ @@ -681,14 +664,19 @@ int irn_vrfy_irg(ir_node *n, ir_graph *irg) ); break; - case iro_Const: + case iro_Const: { + tarval *tv = get_Const_tarval(n); + if (tarval_is_entity(tv)) + assert((get_irn_irg(n) == get_const_code_irg() || + get_entity_peculiarity(tarval_to_entity(tv)) != peculiarity_description) && + "descriptions have no address!"); ASSERT_AND_RET( /* Const: BB --> data */ (mode_is_data (mymode) || mymode == mode_b) /* we want boolean constants for static evaluation */ ,"Const node", 0 /* of Cmp. */ ); - break; + } break; case iro_SymConst: ASSERT_AND_RET( -- 2.20.1