typos fixed
[libfirm] / ir / ana / irloop_t.h
1 /*
2  * Project:     libFIRM
3  * File name:   ir/ana/irloop_t.h
4  * Purpose:     Loop datastructure and access functions -- private stuff.
5  * Author:      Goetz Lindenmaier
6  * Modified by:
7  * Created:     7.2002
8  * CVS-ID:      $Id$
9  * Copyright:   (c) 2002-2003 Universität Karlsruhe
10  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11  */
12
13 /**
14  * @file irloop_t.h
15  * Loop datastructure and access functions -- private stuff.
16  *
17  * @author Goetz Lindenmaier
18  */
19
20 #include "firm_common.h"
21 #include "irgraph_t.h"
22 #include "irloop.h"
23
24 #ifndef _IRLOOP_T_H_
25 #define _IRLOOP_T_H_
26
27 /** The loops datastructure. */
28 struct ir_loop {
29   firm_kind kind;                   /**< A type tag, set to k_ir_loop. */
30
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" */
36
37   /*
38   struct state_entry *mem_phis;
39   struct state_entry *states;
40
41   struct obset **oval;
42   struct loop_node *link;
43   */
44 #ifdef DEBUG_libfirm
45   int loop_nr;             /**< a unique node number for each loop node to make output
46                               readable. */
47   void *link;              /**< GL @@@ For debugging the analyses. */
48 #endif
49
50 };
51
52
53 /** Add a son loop to a father loop. */
54 void add_loop_son(ir_loop *loop, ir_loop *son);
55
56 /** Add a node to a loop. */
57 void add_loop_node(ir_loop *loop, ir_node *n);
58
59 /** Sets the loop a node belonging to. */
60 void set_irn_loop(ir_node *n, ir_loop *loop);
61
62 /* -------- INLINE functions -------- */
63
64 static INLINE int
65 _is_ir_loop(const void *thing) {
66   return (get_kind(thing) == k_ir_loop);
67 }
68
69 static INLINE void
70 _set_irg_loop(ir_graph *irg, ir_loop *loop) {
71   assert(irg);
72   irg->loop = loop;
73 }
74
75 static INLINE ir_loop *
76 _get_irg_loop(ir_graph *irg) {
77   assert(irg);
78   return irg->loop;
79 }
80
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)
84
85 #endif /* _IRLOOP_T_H_ */