* @param loop the loop to mature
* @param obst an obstack, where the new arrays are allocated on
*/
* @param loop the loop to mature
* @param obst an obstack, where the new arrays are allocated on
*/
loop_element *new_children = DUP_ARR_D(loop_element, obst, loop->children);
DEL_ARR_F(loop->children);
loop->children = new_children;
loop_element *new_children = DUP_ARR_D(loop_element, obst, loop->children);
DEL_ARR_F(loop->children);
loop->children = new_children;
return _get_loop_n_sons(loop);
}
/* Returns the pos`th loop_node-child *
* TODO: This method isn`t very efficient ! *
* Returns NULL if there isn`t a pos`th loop_node */
return _get_loop_n_sons(loop);
}
/* Returns the pos`th loop_node-child *
* TODO: This method isn`t very efficient ! *
* Returns NULL if there isn`t a pos`th loop_node */
int child_nr = 0, loop_nr = -1;
assert(loop && loop->kind == k_ir_loop);
int child_nr = 0, loop_nr = -1;
assert(loop && loop->kind == k_ir_loop);
/* Returns the pos'th ir_node-child *
* TODO: This method isn't very efficient ! *
* Returns NULL if there isn't a pos'th ir_node */
/* Returns the pos'th ir_node-child *
* TODO: This method isn't very efficient ! *
* Returns NULL if there isn't a pos'th ir_node */
int child_nr, node_nr = -1;
assert(loop && loop->kind == k_ir_loop);
int child_nr, node_nr = -1;
assert(loop && loop->kind == k_ir_loop);
to check the *(loop_element.kind) field for "k_ir_node" or "k_ir_loop"
and then select the appropriate "loop_element.node" or "loop_element.son".
*/
to check the *(loop_element.kind) field for "k_ir_node" or "k_ir_loop"
and then select the appropriate "loop_element.node" or "loop_element.son".
*/
assert(loop && loop->kind == k_ir_loop && pos < ARR_LEN(loop->children));
return(loop -> children[pos]);
}
assert(loop && loop->kind == k_ir_loop && pos < ARR_LEN(loop->children));
return(loop -> children[pos]);
}
-/** A field to connect additional information to a loop. Only valid
- if libfirm_debug is set. */
-void set_loop_link(ir_loop *loop, void *link) {
+void set_loop_link(ir_loop *loop, void *link)
+{
_set_irg_loop(irg, loop);
}
/* Returns the root loop info (if exists) for an irg. */
_set_irg_loop(irg, loop);
}
/* Returns the root loop info (if exists) for an irg. */
* Allocates a new loop as son of father on the given obstack.
* If father is equal NULL, a new root loop is created.
*/
* Allocates a new loop as son of father on the given obstack.
* If father is equal NULL, a new root loop is created.
*/
- son = obstack_alloc(obst, sizeof(*son));
- memset(son, 0, sizeof(*son));
+ son = OALLOCZ(obst, ir_loop);