From 4f3eecb621874866a54debef83a2bd7488ad19e8 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Mon, 9 Jul 2007 15:24:46 +0000 Subject: [PATCH] use get_irn_n(-1) instead of get_nodes_block [r14994] --- ir/common/irtools.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/ir/common/irtools.c b/ir/common/irtools.c index 134091923..0073fec12 100644 --- a/ir/common/irtools.c +++ b/ir/common/irtools.c @@ -117,27 +117,27 @@ copy_irn_to_irg(ir_node *n, ir_graph *irg) * The copy resides in the same graph in the same block. */ ir_node *exact_copy(const ir_node *n) { - ir_graph *irg = get_irn_irg(n); - ir_node *res, *block = NULL; - - if (is_no_Block(n)) - block = get_nodes_block(n); - - res = new_ir_node(get_irn_dbg_info(n), - irg, - block, - get_irn_op(n), - get_irn_mode(n), - get_irn_arity(n), - get_irn_in(n) + 1); - - - /* Copy the attributes. These might point to additional data. If this - was allocated on the old obstack the pointers now are dangling. This - frees e.g. the memory of the graph_arr allocated in new_immBlock. */ - copy_node_attr(n, res); - new_backedge_info(res); - return res; + ir_graph *irg = get_irn_irg(n); + ir_node *res, *block = NULL; + + if (is_no_Block(n)) + block = get_irn_n(n, -1); + + res = new_ir_node(get_irn_dbg_info(n), + irg, + block, + get_irn_op(n), + get_irn_mode(n), + get_irn_arity(n), + get_irn_in(n) + 1); + + + /* Copy the attributes. These might point to additional data. If this + was allocated on the old obstack the pointers now are dangling. This + frees e.g. the memory of the graph_arr allocated in new_immBlock. */ + copy_node_attr(n, res); + new_backedge_info(res); + return res; } void firm_pset_dump(pset *set) -- 2.20.1