- ir_loop *father, *son;
-
- father = current_loop;
-
- son = obstack_alloc(outermost_ir_graph->obst, sizeof(*son));
- memset(son, 0, sizeof(*son));
- son->kind = k_ir_loop;
- son->children = NEW_ARR_F(loop_element, 0);
- son->n_nodes = 0;
- son->n_sons = 0;
- son->link = NULL;
- if (father) {
- son->outer_loop = father;
- add_loop_son(father, son);
- son->depth = father->depth + 1;
- } else { /* The root loop */
- son->outer_loop = son;
- son->depth = 0;
- }
-
-#ifdef DEBUG_libfirm
- son->loop_nr = get_irp_new_node_nr();
-#endif
+ ir_loop *father = current_loop;
+ ir_loop *son = alloc_loop(father, outermost_ir_graph->obst);