Commit 229c9d24 authored by Christian Würdig's avatar Christian Würdig
Browse files

added function to remove a keepalive edge

[r8298]
parent f07f4373
......@@ -888,6 +888,25 @@ void set_End_keepalives(ir_node *end, int n, ir_node *in[]) {
edges_notify_edge(end, END_KEEPALIVE_OFFSET + i, NULL, end->in[1 + END_KEEPALIVE_OFFSET + i], irg);
}
}
/* Set new keep-alives from old keep-alives, skipping irn */
void remove_End_keepalive(ir_node *end, ir_node *irn) {
int n = get_End_n_keepalives(end);
ir_node **in;
int i, idx;
NEW_ARR_A(ir_node *, in, n);
for (idx = i = 0; i < n; ++i) {
ir_node *old_ka = get_End_keepalive(end, i);
/* skip irn */
if (old_ka != irn)
in[idx++] = old_ka;
}
/* set new keep-alives */
set_End_keepalives(end, idx, in);
}
void
free_End (ir_node *end) {
......
......@@ -391,6 +391,9 @@ void set_End_keepalive(ir_node *end, int pos, ir_node *ka);
/** Set new keep-alives */
void set_End_keepalives(ir_node *end, int n, ir_node *in[]);
/* Set new keep-alives from old keep-alives, skipping irn */
void remove_End_keepalive(ir_node *end, ir_node *irn);
/** Some parts of the End node are allocated separately -- their memory
is not recovered by dead_node_elimination if a End node is dead.
free_End() frees these data structures. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment