libFirm 1.20
Dynamic Reverse Edges

Defines

#define foreach_out_edge_kind(irn, edge, kind)   for(edge = get_irn_out_edge_first_kind(irn, kind); edge; edge = get_irn_out_edge_next(irn, edge))
 A convenience iteration macro over all out edges of a node.
#define foreach_out_edge_kind_safe(irn, edge, ne, kind)
 A convenience iteration macro over all out edges of a node, which is safe against alteration of the current edge.
#define foreach_out_edge(irn, edge)   foreach_out_edge_kind(irn, edge, EDGE_KIND_NORMAL)
 Convenience macro for normal out edges.
#define foreach_out_edge_safe(irn, edge, tmp)   foreach_out_edge_kind_safe(irn, edge, tmp, EDGE_KIND_NORMAL)
 Convenience macro for normal out edges.
#define foreach_block_succ(bl, edge)   foreach_out_edge_kind(bl, edge, EDGE_KIND_BLOCK)
 A convenience iteration macro for all control flow edges.
#define edges_reroute(old, nw)   edges_reroute_kind(old, nw, EDGE_KIND_NORMAL)
 Convenience version of edges_reroute_kind() with EDGE_KIND_NORMAL.
#define edges_activated(irg)   (edges_activated_kind(irg, EDGE_KIND_NORMAL) && edges_activated_kind(irg, EDGE_KIND_BLOCK))
 Conventience version of edges_activated_kind() for EDGE_KIND_NORMAL and EDGE_KIND_BLOCK.
#define get_irn_n_edges(irn)   get_irn_n_edges_kind(irn, EDGE_KIND_NORMAL)
 Conventience version of get_irn_n_edges_kind() with EDGE_KIND_NORMAL.
#define get_irn_out_edge_first(irn)   get_irn_out_edge_first_kind(irn, EDGE_KIND_NORMAL)
 Convenience version of get_irn_out_edge_first_kind() with EDGE_KIND_NORMAL.
#define get_block_succ_first(irn)   get_irn_out_edge_first_kind(irn, EDGE_KIND_BLOCK)
 Convenience version of get_irn_out_edge_first_kind() with EDGE_KIND_BLOCK.
#define get_block_succ_next(irn, last)   get_irn_out_edge_next(irn, last)
 Convenience version of get_irn_out_edge_next() with EDGE_KIND_BLOCK.

Typedefs

typedef struct ir_edge_t ir_edge_t
 Dynamic Reverse Edge.

Enumerations

enum  ir_edge_kind_t {
  EDGE_KIND_FIRST, EDGE_KIND_NORMAL = EDGE_KIND_FIRST, EDGE_KIND_BLOCK, EDGE_KIND_DEP,
  EDGE_KIND_LAST
}
 Supported Edge kinds. More...

Functions

const ir_edge_tget_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_tget_irn_out_edge_next (const ir_node *irn, const ir_edge_t *last)
 Returns the next edge in the out list of some node.
ir_nodeget_edge_src_irn (const ir_edge_t *edge)
 Returns the source node of an edge.
int get_edge_src_pos (const ir_edge_t *edge)
 Returns the position of an edge.
const ir_edge_tget_irn_edge_kind (const ir_node *irn, int pos, ir_edge_kind_t kind)
 Returns the edge object of an outgoing edge at a 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_kind (const ir_graph *irg, ir_edge_kind_t kind)
 Checks if the out edges are activated.
void edges_activate_kind (ir_graph *irg, ir_edge_kind_t kind)
 Activates the edges for an irg.
void edges_deactivate_kind (ir_graph *irg, ir_edge_kind_t kind)
 Deactivates the edges for an irg.
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.
int edges_verify (ir_graph *irg)
 Verifies the out edges of graph irg.
int edges_verify_kind (ir_graph *irg, ir_edge_kind_t kind)
 Verifies a certrain kind of out edges of graph irg.
void edges_init_dbg (int do_dbg)
 Sets edge verification flag.
ir_graph_pass_tirg_verify_edges_pass (const char *name, unsigned assert_on_problem)
 Creates an ir_graph pass for edges_verify().
void edges_activate (ir_graph *irg)
 Activates data and block edges for an irg.
void edges_deactivate (ir_graph *irg)
 Deactivates data and block edges for an irg.
int edges_assure (ir_graph *irg)
 Ensures that edges are activated.
int edges_assure_kind (ir_graph *irg, ir_edge_kind_t kind)
 Ensures that edges of a given kind are activated.
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_edges (ir_node *start, irg_walk_func *pre, irg_walk_func *post, void *env)
 Graph walker following EDGE_KIND_NORMAL edges.
void edges_reset_private_data (ir_graph *irg, int offset, unsigned size)
 Reset the user's private data at offset 'offset' The user has to remember his offset and the size of his data! Caution: Using wrong values here can destroy other users private data!

Define Documentation

#define edges_activated (   irg)    (edges_activated_kind(irg, EDGE_KIND_NORMAL) && edges_activated_kind(irg, EDGE_KIND_BLOCK))

Conventience version of edges_activated_kind() for EDGE_KIND_NORMAL and EDGE_KIND_BLOCK.

Definition at line 195 of file iredges.h.

#define edges_reroute (   old,
  nw 
)    edges_reroute_kind(old, nw, EDGE_KIND_NORMAL)

Convenience version of edges_reroute_kind() with EDGE_KIND_NORMAL.

Definition at line 193 of file iredges.h.

#define foreach_block_succ (   bl,
  edge 
)    foreach_out_edge_kind(bl, edge, EDGE_KIND_BLOCK)

A convenience iteration macro for all control flow edges.

Definition at line 95 of file iredges.h.

#define foreach_out_edge (   irn,
  edge 
)    foreach_out_edge_kind(irn, edge, EDGE_KIND_NORMAL)

Convenience macro for normal out edges.

Definition at line 85 of file iredges.h.

#define foreach_out_edge_kind (   irn,
  edge,
  kind 
)    for(edge = get_irn_out_edge_first_kind(irn, kind); edge; edge = get_irn_out_edge_next(irn, edge))

A convenience iteration macro over all out edges of a node.

Parameters:
irnThe node.
kindThe edge's kind.
edgeAn ir_edge_t pointer which shall be set to the current edge.

Definition at line 66 of file iredges.h.

#define foreach_out_edge_kind_safe (   irn,
  edge,
  ne,
  kind 
)
Value:
for((edge) = (get_irn_out_edge_first_kind(irn, kind)), (ne) = ((edge) ? (get_irn_out_edge_next(irn, edge)) : NULL); \
        edge; (edge) = (ne), (ne) = ((edge) ? (get_irn_out_edge_next(irn, edge)) : NULL))

A convenience iteration macro over all out edges of a node, which is safe against alteration of the current edge.

Parameters:
irnThe node.
edgeAn ir_edge_t pointer which shall be set to the current edge.
neThe next edge, enables alteration safe edge processing.
kindThe kind of the edge.

Definition at line 78 of file iredges.h.

#define foreach_out_edge_safe (   irn,
  edge,
  tmp 
)    foreach_out_edge_kind_safe(irn, edge, tmp, EDGE_KIND_NORMAL)

Convenience macro for normal out edges.

Definition at line 90 of file iredges.h.

#define get_block_succ_first (   irn)    get_irn_out_edge_first_kind(irn, EDGE_KIND_BLOCK)

Convenience version of get_irn_out_edge_first_kind() with EDGE_KIND_BLOCK.

Definition at line 209 of file iredges.h.

#define get_block_succ_next (   irn,
  last 
)    get_irn_out_edge_next(irn, last)

Convenience version of get_irn_out_edge_next() with EDGE_KIND_BLOCK.

Definition at line 214 of file iredges.h.

#define get_irn_n_edges (   irn)    get_irn_n_edges_kind(irn, EDGE_KIND_NORMAL)

Conventience version of get_irn_n_edges_kind() with EDGE_KIND_NORMAL.

Definition at line 199 of file iredges.h.

#define get_irn_out_edge_first (   irn)    get_irn_out_edge_first_kind(irn, EDGE_KIND_NORMAL)

Convenience version of get_irn_out_edge_first_kind() with EDGE_KIND_NORMAL.

Definition at line 204 of file iredges.h.


Typedef Documentation

typedef struct ir_edge_t ir_edge_t

Dynamic Reverse Edge.

Definition at line 72 of file firm_types.h.


Enumeration Type Documentation

Supported Edge kinds.

Enumerator:
EDGE_KIND_NORMAL 

Normal data flow edges.

EDGE_KIND_BLOCK 

Block to Block control flow edges.

EDGE_KIND_DEP 

Dependency edges.

Definition at line 34 of file iredgekinds.h.


Function Documentation

void edges_activate ( ir_graph irg)

Activates data and block edges for an irg.

If the irg phase is phase_backend, Dependence edges are additionally activated.

Parameters:
irgThe graph to activate the edges for.
void edges_activate_kind ( ir_graph irg,
ir_edge_kind_t  kind 
)

Activates the edges for an irg.

Parameters:
irgThe graph to activate the edges for.
kindThe edge kind.
int edges_activated_kind ( const ir_graph irg,
ir_edge_kind_t  kind 
)

Checks if the out edges are activated.

Parameters:
irgThe graph.
kindThe edge kind.
Returns:
1, if the edges are present for the given irg, 0 if not.
int edges_assure ( ir_graph irg)

Ensures that edges are activated.

Parameters:
irgthe IR graph
Returns:
0 if edges was deactivated before the call, 1 else
int edges_assure_kind ( ir_graph irg,
ir_edge_kind_t  kind 
)

Ensures that edges of a given kind are activated.

Parameters:
irgthe IR graph
kindthe edge kind
Returns:
0 if edges was deactivated before the call, 1 else
void edges_deactivate ( ir_graph irg)

Deactivates data and block edges for an irg.

If the irg phase is phase_backend, Dependence edges are additionally deactivated.

Parameters:
irgThe graph.
void edges_deactivate_kind ( ir_graph irg,
ir_edge_kind_t  kind 
)

Deactivates the edges for an irg.

Parameters:
irgThe graph.
kindThe edge kind.
void edges_init_dbg ( int  do_dbg)

Sets edge verification flag.

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.

Parameters:
oldthe old node
nwthe new node
kindthe edge kind
void edges_reset_private_data ( ir_graph irg,
int  offset,
unsigned  size 
)

Reset the user's private data at offset 'offset' The user has to remember his offset and the size of his data! Caution: Using wrong values here can destroy other users private data!

Parameters:
irgthe IR graph to operate on
offsetoffset of the private data inside the edge
sizelength of the private data inside the edge
int edges_verify ( ir_graph irg)

Verifies the out edges of graph irg.

Returns:
1 if a problem was found, 0 otherwise
int edges_verify_kind ( ir_graph irg,
ir_edge_kind_t  kind 
)

Verifies a certrain kind of out edges of graph irg.

Returns:
1 if a problem was found, 0 otherwise
ir_node* get_edge_src_irn ( const ir_edge_t edge)

Returns the source node of an edge.

Parameters:
edgeThe edge.
Returns:
The source node of that edge.
int get_edge_src_pos ( const ir_edge_t edge)

Returns the position of an edge.

Parameters:
edgeThe edge.
Returns:
The position in the in array of that edges source.
const ir_edge_t* get_irn_edge_kind ( const ir_node irn,
int  pos,
ir_edge_kind_t  kind 
)

Returns the edge object of an outgoing edge at a node.

Parameters:
irnThe node at which the edge originates.
posThe position of the edge.
kindThe kind of the edge.
Returns:
The corresponding edge object or NULL, if no such edge exists.
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.

Parameters:
irnThe node.
kindThe kind.
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.

Note:
There is no order on out edges. First in this context only means, that you get some starting point into the list of edges.
Parameters:
irnThe node.
kindThe kind of the edge.
Returns:
The first out edge that points to this node.
const ir_edge_t* get_irn_out_edge_next ( const ir_node irn,
const ir_edge_t last 
)

Returns the next edge in the out list of some node.

Parameters:
irnThe node.
lastThe last out edge you have seen.
Returns:
The next out edge in irn 's out list after last.
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.

Uses the block visited flag, so that it can be interleaved with another walker.

Parameters:
blockthe start block
prethe pre visit function
postthe post visit function
envthe environment for the walker
ir_graph_pass_t* irg_verify_edges_pass ( const char *  name,
unsigned  assert_on_problem 
)

Creates an ir_graph pass for edges_verify().

Parameters:
namethe name of this pass or NULL
assert_on_problemassert if problems were found
Returns:
the newly created ir_graph pass
void irg_walk_edges ( ir_node start,
irg_walk_func pre,
irg_walk_func post,
void *  env 
)

Graph walker following EDGE_KIND_NORMAL edges.