Beautified
[libfirm] / ir / ir / iredges.h
1
2 /**
3  * Public header for the automatically updating outs.
4  * @author Sebastian Hack
5  * @date 3.2.2005
6  */
7
8 #ifndef _FIRM_EDGES_H
9 #define _FIRM_EDGES_H
10
11 #include "irnode.h"
12
13 #ifndef _IR_EDGE_TYPEDEF_
14 #define _IR_EDGE_TYPEDEF_
15 typedef struct _ir_edge_t ir_edge_t;
16 #endif
17
18 /**
19  * Get the first edge pointing to some node.
20  * @note There is no order on out edges. First in this context only
21  * means, that you get some starting point into the list of edges.
22  * @param irn The node.
23  * @return The first out edge that points to this node.
24  */
25 const ir_edge_t *get_irn_out_edge_first(const ir_node *irn);
26
27 /**
28  * Get the next edge in the out list of some node.
29  * @param irn The node.
30  * @param last The last out edge you have seen.
31  * @return The next out edge in @p irn 's out list after @p last.
32  */
33 const ir_edge_t *get_irn_out_edge_next(const ir_node *irn,
34                 const ir_edge_t *last);
35
36 /**
37  * A convenience iteration macro over all out edges of a node.
38  * @param irn The node.
39  * @param edge An @c ir_edge_t pointer which shall be set to the current
40  * edge.
41  */
42 #define foreach_out_edge(irn,edge) \
43         for(edge = get_irn_out_edge_first(irn); edge; edge = get_irn_out_edge_next(irn, edge))
44
45 /*
46  * Get the source node of an edge.
47  * @param edge The edge.
48  * @return The source node of that edge.
49  */
50 ir_node *get_edge_src_irn(const ir_edge_t *edge);
51
52 /**
53  * Get the position of an edge.
54  * @param edge.
55  * @return The position in the in array of that edges source.
56  */
57 extern int get_edge_src_pos(const ir_edge_t *edge);
58
59 extern int edges_activated(const ir_graph *irg);
60
61 extern void edges_activate(ir_graph *irg);
62
63 extern void edges_deactivate(ir_graph *irg);
64
65
66 #endif /* _FIRM_EDGES_H */