3 * File name: ir/ana/irloop_t.h
4 * Purpose: Loop datastructure and access functions -- private stuff.
5 * Author: Goetz Lindenmaier
9 * Copyright: (c) 2002-2003 Universität Karlsruhe
10 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
15 * Loop datastructure and access functions -- private stuff.
17 * @author Goetz Lindenmaier
20 #include "firm_common.h"
21 #include "irgraph_t.h"
27 /** The loops datastructure. */
29 firm_kind kind; /**< A type tag, set to k_ir_loop. */
31 struct ir_loop *outer_loop; /**< The outer loop */
32 loop_element *children; /**< Mixed array: Contains sons and loop_nodes */
33 int depth; /**< Nesting depth */
34 int n_sons; /**< Number of ir_nodes in array "children" */
35 int n_nodes; /**< Number of loop_nodes in array "children" */
38 struct state_entry *mem_phis;
39 struct state_entry *states;
42 struct loop_node *link;
45 int loop_nr; /**< a unique node number for each loop node to make output
47 void *link; /**< GL @@@ For debugging the analyses. */
53 /** Add a son loop to a father loop. */
54 void add_loop_son(ir_loop *loop, ir_loop *son);
56 /** Add a node to a loop. */
57 void add_loop_node(ir_loop *loop, ir_node *n);
59 /** Sets the loop a node belonging to. */
60 void set_irn_loop(ir_node *n, ir_loop *loop);
62 /* -------- INLINE functions -------- */
65 _is_ir_loop(const void *thing) {
66 return (get_kind(thing) == k_ir_loop);
70 _set_irg_loop(ir_graph *irg, ir_loop *loop) {
75 static INLINE ir_loop *
76 _get_irg_loop(ir_graph *irg) {
81 #define is_ir_loop(thing) _is_ir_loop(thing)
82 #define set_irg_loop(irg, loop) _set_irg_loop(irg, loop)
83 #define get_irg_loop(irg) _get_irg_loop(irg)
85 #endif /* _IRLOOP_T_H_ */