12 #ifndef FIRM_IR_IREDGES_H
13 #define FIRM_IR_IREDGES_H
15 #include "firm_types.h"
16 #include "iredgekinds.h"
72 #define foreach_out_edge_kind(irn, edge, kind) \
73 for (ir_edge_t const *edge = get_irn_out_edge_first_kind(irn, kind); edge; edge = get_irn_out_edge_next(irn, edge, kind))
83 #define foreach_out_edge_kind_safe(irn, edge, kind) \
84 for (ir_edge_t const *edge = get_irn_out_edge_first_kind((irn), (kind)), *edge##__next; edge; edge = edge##__next) \
85 if (edge##__next = get_irn_out_edge_next((irn), edge, (kind)), 0) {} else
90 #define foreach_out_edge(irn, edge) foreach_out_edge_kind(irn, edge, EDGE_KIND_NORMAL)
95 #define foreach_out_edge_safe(irn, edge) foreach_out_edge_kind_safe(irn, edge, EDGE_KIND_NORMAL)
100 #define foreach_block_succ(bl, edge) foreach_out_edge_kind(bl, edge, EDGE_KIND_BLOCK)
void edges_activate_kind(ir_graph *irg, ir_edge_kind_t kind)
Activates the edges for an irg.
void edges_reroute(ir_node *old, ir_node *nw)
Reroutes edges of EDGE_KIND_NORMAL from an old node to a new one.
void edges_deactivate(ir_graph *irg)
Deactivates data and block edges for an irg.
ir_node * get_edge_src_irn(const ir_edge_t *edge)
Returns the source node of an edge.
void edges_reroute_kind(ir_node *old, ir_node *nw, ir_edge_kind_t kind)
Reroutes edges of a specified kind from an old node to a new one.
const ir_edge_t * get_irn_out_edge_next(const ir_node *irn, const ir_edge_t *last, ir_edge_kind_t kind)
Returns the next edge in the out list of some node.
struct ir_graph ir_graph
Procedure Graph.
int get_irn_n_edges(const ir_node *irn)
Returns the number of registered out edges with EDGE_KIND_NORMAL.
ir_edge_kind_t
Supported Edge kinds.
void edges_activate(ir_graph *irg)
Activates data and block edges for an irg.
int get_edge_src_pos(const ir_edge_t *edge)
Returns the position of an edge.
struct ir_edge_t ir_edge_t
Dynamic Reverse Edge.
int edges_verify_kind(ir_graph *irg, ir_edge_kind_t kind)
Verifies a certrain kind of out edges of graph irg.
const ir_edge_t * get_block_succ_first(const ir_node *block)
Returns the first edge pointing to a successor block.
void edges_reroute_except(ir_node *old, ir_node *nw, ir_node *exception)
reroutes (normal) edges from an old node to a new node, except for the exception node which keeps its...
int edges_activated_kind(const ir_graph *irg, ir_edge_kind_t kind)
Checks if the out edges are activated.
void edges_deactivate_kind(ir_graph *irg, ir_edge_kind_t kind)
Deactivates the edges for an irg.
void assure_edges_kind(ir_graph *irg, ir_edge_kind_t kind)
Ensures that edges of a given kind are activated.
const ir_edge_t * get_irn_out_edge_first_kind(const ir_node *irn, ir_edge_kind_t kind)
Returns the first edge pointing to some node.
const ir_edge_t * get_irn_out_edge_first(const ir_node *irn)
Returns the first edge pointing to some node.
void irg_walk_edges(ir_node *start, irg_walk_func *pre, irg_walk_func *post, void *env)
Graph walker following EDGE_KIND_NORMAL edges.
void assure_edges(ir_graph *irg)
Ensures that edges are activated.
int edges_verify(ir_graph *irg)
Verifies the out edges of graph irg.
void irg_block_edges_walk(ir_node *block, irg_walk_func *pre, irg_walk_func *post, void *env)
Walks only over Block nodes in the graph.
void irg_walk_func(ir_node *, void *)
type for graph-walk callbacks
void edges_init_dbg(int do_dbg)
Sets edge verification flag.
struct ir_node ir_node
Procedure Graph Node.
int get_irn_n_edges_kind(const ir_node *irn, ir_edge_kind_t kind)
Returns the number of registered out edges for a specific kind.
int edges_activated(const ir_graph *irg)
Checks if out edges with EDG_KIND_NORMAL and EDGE_KIND_BLOCK are activated.