Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
ir_graph_util.c File Reference
#include <stdio.h>
#include <assert.h>
#include "ir_graph_util.h"
Include dependency graph for ir_graph_util.c:

Go to the source code of this file.

Defines

#define VISITED   TRUE

Functions

GRAPHbuild_graph_u (VINDEX vertex_size, EINDEX edge_size, MEM_POOL *m)
GRAPHbuild_graph (MEM_POOL *m)
static void grow_vertex (GRAPH *g)
static void grow_edge (GRAPH *g)
VINDEX add_vertex (GRAPH *g, void *user)
EINDEX add_edge (GRAPH *g, VINDEX from, VINDEX to, void *user)
BOOL is_vertex (GRAPH *g, VINDEX vertex)
VINDEX next_vertex (GRAPH *g, VINDEX vertex)
void delete_edge (GRAPH *g, EINDEX edge)
void * delete_vertex (GRAPH *g, VINDEX vertex)
BOOL is_edge (GRAPH *g, EINDEX edge)
void * get_vertex (GRAPH *g, VINDEX vertex)
int num_preds (GRAPH *g, VINDEX vertex)
int num_succs (GRAPH *g, VINDEX vertex)
void * get_edge (GRAPH *g, VINDEX from, VINDEX to)
int edge_count (GRAPH *g, VINDEX from, VINDEX to)
void * get_edge_u (GRAPH *g, EINDEX e)
void set_edge_u (GRAPH *g, EINDEX e, void *user)
V_ITERcreate_vertex_iter (GRAPH *g, VINDEX vertex, MEM_POOL *m)
VINDEX first_v_preds (V_ITER *v_i)
VINDEX next_v_preds (V_ITER *v_i)
VINDEX first_v_succs (V_ITER *v_i)
VINDEX next_v_succs (V_ITER *v_i)
int get_vertex_level (GRAPH *g, VINDEX v)
void set_vertex_level (GRAPH *g, VINDEX v, int level)
static void Search (GRAPH *g, VINDEX v, DFN *d, BOOL *visit, EINDEX ei)
DFNDepth_First_Ordering (GRAPH *g, MEM_POOL *m)
void Print_Pred (GRAPH *g, VINDEX v, void(*prn)())
void Print_DFN (DFN *d, GRAPH *g, void(*prn)(), void(*prn_c)())
void Free_DFN (DFN *d, MEM_POOL *m)

Variables

static char * Malloc_Mem_Pool
static int lvl

Define Documentation

#define VISITED   TRUE

Definition at line 712 of file ir_graph_util.c.

Referenced by Search().


Function Documentation

EINDEX add_edge ( GRAPH g,
VINDEX  from,
VINDEX  to,
void *  user 
)

Definition at line 245 of file ir_graph_util.c.

References EDGE_etype, EDGE_from, EDGE_nfrom, EDGE_nto, EDGE_to, EDGE_user, GR_ASSERT, GRAPH_e_i, GRAPH_ecnt, GRAPH_efree, GRAPH_m, GRAPH_v_i, grow_edge(), is_vertex(), VERTEX_fcnt, VERTEX_from, VERTEX_tcnt, and VERTEX_to.

Referenced by build_call_graph().

Here is the call graph for this function:

VINDEX add_vertex ( GRAPH g,
void *  user 
)

Definition at line 207 of file ir_graph_util.c.

References GRAPH_m, GRAPH_v_i, GRAPH_vcnt, GRAPH_vfree, grow_vertex(), INVALID_EINDEX, VERTEX_fcnt, VERTEX_from, VERTEX_level, VERTEX_tcnt, VERTEX_to, and VERTEX_user.

Referenced by build_call_graph().

Here is the call graph for this function:

Definition at line 123 of file ir_graph_util.c.

References bzero(), GR_ASSERT, GRAPH_ecnt, GRAPH_efree, GRAPH_m, GRAPH_root, GRAPH_vcnt, GRAPH_vfree, INVALID_VINDEX, and MEM_POOL_Alloc.

Here is the call graph for this function:

GRAPH* build_graph_u ( VINDEX  vertex_size,
EINDEX  edge_size,
MEM_POOL m 
)
void delete_edge ( GRAPH g,
EINDEX  edge 
)

Definition at line 328 of file ir_graph_util.c.

References graph::e, EDGE_from, EDGE_nfrom, EDGE_nto, EDGE_to, GR_ASSERT, GRAPH_e_i, GRAPH_ecnt, GRAPH_efree, GRAPH_v_i, INVALID_VINDEX, is_edge(), edge::nto, VERTEX_fcnt, VERTEX_from, VERTEX_tcnt, and VERTEX_to.

Referenced by delete_vertex().

Here is the call graph for this function:

void* delete_vertex ( GRAPH g,
VINDEX  vertex 
)

Definition at line 402 of file ir_graph_util.c.

References delete_edge(), EDGE_nfrom, EDGE_nto, GR_ASSERT, GRAPH_e_i, GRAPH_v_i, GRAPH_vcnt, GRAPH_vfree, INVALID_EINDEX, is_vertex(), VERTEX_fcnt, VERTEX_from, VERTEX_to, and VERTEX_user.

Here is the call graph for this function:

DFN* Depth_First_Ordering ( GRAPH g,
MEM_POOL m 
)

Definition at line 768 of file ir_graph_util.c.

References bzero(), d, DFN_end, DFN_first, DFN_user, DFN_v_list, edge_count(), GR_ASSERT, GRAPH_ecnt, GRAPH_root, GRAPH_vcnt, GRAPH_vmax, INVALID_EINDEX, INVALID_VINDEX, MEM_POOL_Alloc, MEM_POOL_FREE, NULL, and Search().

Referenced by build_call_graph().

Here is the call graph for this function:

int edge_count ( GRAPH g,
VINDEX  from,
VINDEX  to 
)

Definition at line 502 of file ir_graph_util.c.

References EDGE_nfrom, EDGE_to, GR_ASSERT, GRAPH_e_i, GRAPH_v_i, INVALID_EINDEX, is_vertex(), and VERTEX_from.

Referenced by Depth_First_Ordering().

Here is the call graph for this function:

void Free_DFN ( DFN d,
MEM_POOL m 
)

Definition at line 870 of file ir_graph_util.c.

References DFN_v_list, and MEM_POOL_FREE.

void* get_edge ( GRAPH g,
VINDEX  from,
VINDEX  to 
)

Definition at line 480 of file ir_graph_util.c.

References EDGE_nfrom, EDGE_to, EDGE_user, GR_ASSERT, GRAPH_e_i, GRAPH_v_i, INVALID_EINDEX, is_vertex(), and VERTEX_from.

Here is the call graph for this function:

void* get_edge_u ( GRAPH g,
EINDEX  e 
)

Definition at line 524 of file ir_graph_util.c.

References EDGE_user, GR_ASSERT, GRAPH_e_i, and is_edge().

Referenced by Print_Pred(), and Search().

Here is the call graph for this function:

void* get_vertex ( GRAPH g,
VINDEX  vertex 
)

Definition at line 450 of file ir_graph_util.c.

References GR_ASSERT, GRAPH_v_i, is_vertex(), and VERTEX_user.

Here is the call graph for this function:

int get_vertex_level ( GRAPH g,
VINDEX  v 
)

Definition at line 674 of file ir_graph_util.c.

References GRAPH_v_i, and VERTEX_level.

Referenced by Print_DFN().

static void grow_edge ( GRAPH g) [static]
static void grow_vertex ( GRAPH g) [static]
BOOL is_edge ( GRAPH g,
EINDEX  edge 
)

Definition at line 441 of file ir_graph_util.c.

References EDGE_from, GRAPH_e_i, GRAPH_emax, and INVALID_VINDEX.

Referenced by delete_edge(), and get_edge_u().

Definition at line 647 of file ir_graph_util.c.

References EDGE_nfrom, EDGE_to, GRAPH_e_i, INVALID_VINDEX, MEM_POOL_FREE, V_ITER_c_e, V_ITER_g, V_ITER_m, and V_ITER_nfrom.

Referenced by Search().

VINDEX next_vertex ( GRAPH g,
VINDEX  vertex 
)

Definition at line 312 of file ir_graph_util.c.

References GR_ASSERT, GRAPH_vmax, INVALID_VINDEX, and is_vertex().

Here is the call graph for this function:

int num_preds ( GRAPH g,
VINDEX  vertex 
)

Definition at line 460 of file ir_graph_util.c.

References GR_ASSERT, GRAPH_v_i, is_vertex(), and VERTEX_tcnt.

Here is the call graph for this function:

int num_succs ( GRAPH g,
VINDEX  vertex 
)

Definition at line 470 of file ir_graph_util.c.

References GR_ASSERT, GRAPH_v_i, is_vertex(), and VERTEX_fcnt.

Here is the call graph for this function:

void Print_DFN ( DFN d,
GRAPH g,
void(*)()  prn,
void(*)()  prn_c 
)

Definition at line 836 of file ir_graph_util.c.

References DFN_end, DFN_first, DFN_user_i, DFN_v_list_i, get_vertex_level(), and Print_Pred().

Here is the call graph for this function:

void Print_Pred ( GRAPH g,
VINDEX  v,
void(*)()  prn 
)

Definition at line 813 of file ir_graph_util.c.

References create_vertex_iter(), dummy, first_v_preds(), get_edge_u(), GR_ASSERT, INVALID_VINDEX, next_v_preds(), and V_ITER_c_e.

Referenced by Print_DFN().

Here is the call graph for this function:

static void Search ( GRAPH g,
VINDEX  v,
DFN d,
BOOL visit,
EINDEX  ei 
) [static]
void set_edge_u ( GRAPH g,
EINDEX  e,
void *  user 
)

Definition at line 534 of file ir_graph_util.c.

References EDGE_user, and GRAPH_e_i.

Referenced by build_call_graph().

void set_vertex_level ( GRAPH g,
VINDEX  v,
int  level 
)

Definition at line 683 of file ir_graph_util.c.

References GRAPH_v_i, and VERTEX_level.

Referenced by Search().


Variable Documentation

int lvl [static]

Definition at line 714 of file ir_graph_util.c.

Referenced by Search().

char* Malloc_Mem_Pool [static]

Definition at line 713 of file ir_graph_util.c.

Referenced by Search().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines