*/
/**
-* @file irloop.h
-*
-* Computes backedges in the control and data flow.
-*
-* @author Goetz Lindenmaier
-*
-* Only Block and Phi/Filter nodes can have incoming backedges.
-* Constructs loops data structure: indicates loop nesting.
-*/
+ * @file irloop.h
+ *
+ * Computes backedges in the control and data flow.
+ *
+ * @author Goetz Lindenmaier
+ *
+ * Only Block and Phi/Filter nodes can have incoming backedges.
+ * Constructs loops data structure: indicates loop nesting.
+ */
# ifndef _IRLOOP_H_
# define _IRLOOP_H_
ir_loop *get_irg_loop(ir_graph *irg);
/** Returns the loop n is contained in. NULL if node is in no loop. */
-ir_loop *get_irn_loop(ir_node *n);
+ir_loop *get_irn_loop(const ir_node *n);
/** Returns outer loop, itself if outermost. */
-ir_loop *get_loop_outer_loop (ir_loop *loop);
+ir_loop *get_loop_outer_loop (const ir_loop *loop);
/** Returns nesting depth of this loop */
-int get_loop_depth (ir_loop *loop);
+int get_loop_depth (const ir_loop *loop);
/* Sons are the inner loops contained in this loop. */
/** Returns the number of inner loops */
-int get_loop_n_sons (ir_loop *loop);
+int get_loop_n_sons (const ir_loop *loop);
/** Returns the pos`th son loop (inner loop) of a loop.
Returns NULL if there is not a pos`th loop_node. */
ir_node *get_loop_node (ir_loop *loop, int pos);
/** Returns the number of elements contained in loop. */
-int get_loop_n_elements (ir_loop *loop);
+int get_loop_n_elements (const ir_loop *loop);
+
/** Returns a loop element. A loop element can be interpreted as a
kind pointer, an ir_node* or an ir_loop*. */
-loop_element get_loop_element (ir_loop *loop, int pos);
+loop_element get_loop_element (const ir_loop *loop, int pos);
/** Returns the element number of the loop son in loop.
* Returns -1 if not found. O(|elements|). */
-int get_loop_element_pos(ir_loop *loop, void *le);
+int get_loop_element_pos(const ir_loop *loop, void *le);
/** Returns a unique node number for the loop node to make output
readable. If libfirm_debug is not set it returns the loop cast to
int. */
-int get_loop_loop_nr(ir_loop *loop);
+int get_loop_loop_nr(const ir_loop *loop);
/** A field to connect additional information to a loop. Only valid
if libfirm_debug is set, else returns NULL. */
* The resulting loop tree is a possible visiting order for dataflow
* analysis.
*
+ * This algorithm destoyes the link field of block nodes.
+ *
* @returns Maximal depth of loop tree.
*
* @remark
* This algorithm computes only back edge information for Block nodes, not
* for Phi nodes.
*
- * @returns Maximal depth of loop tree. */
+ * This algorithm destoyes the link field of block nodes.
+ *
+ * @returns Maximal depth of loop tree.
+ */
int construct_cf_backedges(ir_graph *irg);
/** Construct interprocedural loop tree for control flow.