X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firvrfy.c;h=a62e6ce3ebe9c1ff2da6a32201f83bb7fd384153;hb=a226465c4f00c94b3e94a7c717e04061625e7a33;hp=12104b66a8fd82e91e182be9eabaf2b8027df3ed;hpb=19a8e44d561f4eb9d766a790a007641086d00581;p=libfirm 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(