summaryrefslogtreecommitdiffhomepage
path: root/ir/be/betranshlp.c
diff options
context:
space:
mode:
authorChristoph Mallon <mallon@cs.uni-saarland.de>2015-01-13 07:20:37 +0100
committerChristoph Mallon <mallon@cs.uni-saarland.de>2015-01-14 07:40:08 +0100
commita24a47c331e9180381b7800136d193b712b33da0 (patch)
treeb1c5f7ba05219db3c705684b8a525db36203af38 /ir/be/betranshlp.c
parent127a6ad9140692bf11242e82a3ad05899c166e9f (diff)
be: Transform the End node in one go instead of adding one keep edge at a time.
new_ir_node() handles dynamic ops correctly for quite some time now.
Diffstat (limited to 'ir/be/betranshlp.c')
-rw-r--r--ir/be/betranshlp.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/ir/be/betranshlp.c b/ir/be/betranshlp.c
index bc0ad9b..0de9ff8 100644
--- a/ir/be/betranshlp.c
+++ b/ir/be/betranshlp.c
@@ -116,20 +116,18 @@ static ir_node *transform_block(ir_node *node)
static ir_node *transform_end(ir_node *node)
{
- /* end has to be duplicated manually because we need a dynamic in array */
+ /* Do not transform predecessors yet to keep the pre-transform
+ * phase from visiting all the graph. */
ir_graph *irg = get_irn_irg(node);
dbg_info *dbgi = get_irn_dbg_info(node);
ir_node *block = be_transform_node(get_nodes_block(node));
- ir_node *new_end = new_ir_node(dbgi, irg, block, op_End, mode_X, -1, NULL);
+ int arity = get_irn_arity(node);
+ ir_node **ins = get_irn_in(node) + 1;
+ ir_node *new_end = new_ir_node(dbgi, irg, block, op_End, mode_X, arity, ins);
copy_node_attr(irg, node, new_end);
set_irg_end(irg, new_end);
- /* do not transform predecessors yet to keep the pre-transform
- * phase from visiting all the graph */
- foreach_irn_in(node, i, in) {
- add_End_keepalive(new_end, in);
- }
be_enqueue_preds(node);
return new_end;