3 * Public header for the automatically updating outs.
4 * @author Sebastian Hack
13 #ifndef _IR_EDGE_TYPEDEF_
14 #define _IR_EDGE_TYPEDEF_
15 typedef struct _ir_edge_t ir_edge_t;
18 #ifndef _IR_BLOCK_EDGE_TYPEDEF_
19 #define _IR_BLOCK_EDGE_TYPEDEF_
20 typedef struct _ir_block_edge_t ir_block_edge_t;
24 * Get the first edge pointing to some node.
25 * @note There is no order on out edges. First in this context only
26 * means, that you get some starting point into the list of edges.
27 * @param irn The node.
28 * @return The first out edge that points to this node.
30 const ir_edge_t *get_irn_out_edge_first(const ir_node *irn);
33 * Get the next edge in the out list of some node.
34 * @param irn The node.
35 * @param last The last out edge you have seen.
36 * @return The next out edge in @p irn 's out list after @p last.
38 const ir_edge_t *get_irn_out_edge_next(const ir_node *irn,
39 const ir_edge_t *last);
42 * A convenience iteration macro over all out edges of a node.
43 * @param irn The node.
44 * @param edge An @c ir_edge_t pointer which shall be set to the current
47 #define foreach_out_edge(irn,edge) \
48 for(edge = get_irn_out_edge_first(irn); edge; edge = get_irn_out_edge_next(irn, edge))
51 * A convenience iteration macro for all control flow edges
52 * leaving a block, and thus are cf successor edges.
53 * @param bl The block.
54 * @param edge An @c ir_edge_t pointer which is set to the current edge.
56 #define foreach_block_succ(bl,edge) \
57 for(edge = get_block_succ_first(bl); edge; edge = get_block_succ_next(bl, edge))
60 * Get the source node of an edge.
61 * @param edge The edge.
62 * @return The source node of that edge.
64 ir_node *get_edge_src_irn(const ir_edge_t *edge);
67 * Get the number of edges pointing to a node.
68 * @param irn The node.
69 * @return The number of edges pointing to this node.
71 int get_irn_n_edges(const ir_node *irn);
74 * Get the position of an edge.
76 * @return The position in the in array of that edges source.
78 extern int get_edge_src_pos(const ir_edge_t *edge);
81 * Check, if the out edges are activated.
82 * @param irg The graph.
83 * @return 1, if the edges are present for the given irg, 0 if not.
85 extern int edges_activated(const ir_graph *irg);
88 * Activate the edges for an irg.
89 * @param irg The graph to activate the edges for.
91 extern void edges_activate(ir_graph *irg);
94 * Deactivate the edges for an irg.
95 * @param irg The graph.
97 extern void edges_deactivate(ir_graph *irg);
99 #endif /* _FIRM_EDGES_H */