-/**
- * Needed for result checking
- */
-static void allocatable_collector(ir_node *node, void *env) {
- struct obstack *obst = env;
- if (!is_Block(node) && is_allocatable_irn(node))
- obstack_ptr_grow(obst, node);
-}
-
-/**
- * This O(n^2) checker checks, if two ifg-connected nodes have the same color.
- */
-static void check_results(ir_graph *irg) {
- struct obstack ob;
- ir_node **nodes, *n1, *n2;
- int i, o;
-
- obstack_init(&ob);
- irg_walk_graph(irg, allocatable_collector, NULL, &ob);
- obstack_ptr_grow(&ob, NULL);
- nodes = (ir_node **) obstack_finish(&ob);
- for (i = 0, n1 = nodes[i]; n1; n1 = nodes[++i]) {
- assert(! (is_allocatable_irn(n1) && get_irn_color(n1) == NO_COLOR));
- for (o = i+1, n2 = nodes[o]; n2; n2 = nodes[++o])
- if (phi_ops_interfere(n1, n2) && get_irn_color(n1) == get_irn_color(n2)) {
- DBG((dbg, 0, "Error: %n in %n and %n in %n\n", n1, get_nodes_block(n1), n2, get_nodes_block(n2)));
- assert(0 && "Interfering values have the same color!");
- }
- }
- obstack_free(&ob, NULL);
- DBG((dbg, 1, "The checker seems to be happy!\n"));
-}
-