]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/graphds.h
Remove various unused items.
[thirdparty/gcc.git] / gcc / graphds.h
CommitLineData
3f9439d7 1/* Graph representation.
711789cc 2 Copyright (C) 2007-2013 Free Software Foundation, Inc.
3f9439d7 3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8c4c00c1 8Software Foundation; either version 3, or (at your option) any later
3f9439d7 9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14for more details.
15
16You should have received a copy of the GNU General Public License
8c4c00c1 17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
3f9439d7 19
20/* Structure representing edge of a graph. */
21
f780cc25 22struct graph_edge
3f9439d7 23{
24 int src, dest; /* Source and destination. */
f780cc25 25 struct graph_edge *pred_next, *succ_next;
3f9439d7 26 /* Next edge in predecessor and successor lists. */
27 void *data; /* Data attached to the edge. */
28};
29
30/* Structure representing vertex of a graph. */
31
32struct vertex
33{
f780cc25 34 struct graph_edge *pred, *succ;
3f9439d7 35 /* Lists of predecessors and successors. */
36 int component; /* Number of dfs restarts before reaching the
37 vertex. */
38 int post; /* Postorder number. */
39 void *data; /* Data attached to the vertex. */
40};
41
42/* Structure representing a graph. */
43
44struct graph
45{
46 int n_vertices; /* Number of vertices. */
47 struct vertex *vertices;
48 /* The vertices. */
49};
50
51struct graph *new_graph (int);
52void dump_graph (FILE *, struct graph *);
f780cc25 53struct graph_edge *add_edge (struct graph *, int, int);
3f9439d7 54void identify_vertices (struct graph *, int, int);
55int graphds_dfs (struct graph *, int *, int,
f1f41a6c 56 vec<int> *, bool, bitmap);
3f9439d7 57int graphds_scc (struct graph *, bitmap);
58void graphds_domtree (struct graph *, int, int *, int *, int *);
f780cc25 59typedef void (*graphds_edge_callback) (struct graph *, struct graph_edge *);
3f9439d7 60void for_each_edge (struct graph *, graphds_edge_callback);
61void free_graph (struct graph *g);