- for (i = get_irn_arity(irn) - 1; i >= 0; i--) {
- pred = get_irn_n(irn, i);
- set_irn_n(irn_copy, i, get_irn_link(pred));
+ if (get_irn_op(irn) == op_End) {
+ /* Handle the keep-alives. This must be done separately, because
+ the End node was NOT copied */
+ for (i = 0; i < get_End_n_keepalives(irn); ++i)
+ add_End_keepalive(irn_copy, get_irn_link(get_End_keepalive(irn, i)));
+ }
+ else {
+ for (i = get_irn_arity(irn) - 1; i >= 0; i--) {
+ pred = get_irn_n(irn, i);
+ set_irn_n(irn_copy, i, get_irn_link(pred));
+ }