Commit 11d8edd4 authored by Michael Beck's avatar Michael Beck
Browse files

Added a kill_node() function to support the out edges

[r14454]
parent a4c6863c
......@@ -73,4 +73,10 @@ void collect_phiprojs(ir_graph *irg);
*/
void part_block(ir_node *node);
/**
* Kill a node by setting its predecessors to Bad and finally
* exchange the node by Bad itself.
*/
void kill_node(ir_node *node);
#endif /* FIRM_IR_IRGMOD_H */
......@@ -218,3 +218,15 @@ void part_block(ir_node *node) {
set_optimize(rem_opt);
}
/* kill a node by setting its predecessors to Bad and finally exchange the node by Bad itself. */
void kill_node(ir_node *node) {
ir_graph *irg = get_irn_irg(node);
ir_node *bad = get_irg_bad(irg);
int i;
for (i = get_irn_arity(node) - 1; i >= -1; --i) {
set_irn_n(node, i, bad);
}
exchange(node, bad);
}
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