aboutsummaryrefslogtreecommitdiff
path: root/gcc/graphds.h
diff options
context:
space:
mode:
authorZdenek Dvorak <dvorakz@suse.cz>2007-06-03 21:10:44 +0200
committerZdenek Dvorak <rakdver@gcc.gnu.org>2007-06-03 19:10:44 +0000
commit66f97d31f233e10870728947731db603b5dc0c9c (patch)
tree00a98b1b54819809ffb6999717d9263ac5558fe2 /gcc/graphds.h
parentb6a9c30c80a0713b0b27f434dfe34b0552fc7384 (diff)
downloadgcc-66f97d31f233e10870728947731db603b5dc0c9c.zip
gcc-66f97d31f233e10870728947731db603b5dc0c9c.tar.gz
gcc-66f97d31f233e10870728947731db603b5dc0c9c.tar.bz2
cfgloopmanip.c (remove_path, [...]): Change dom_bbs to vector.
* cfgloopmanip.c (remove_path, loopify, duplicate_loop_to_header_edge): Change dom_bbs to vector. Add argument to iterate_fix_dominators call. * loop-unroll.c (unroll_loop_runtime_iterations): Ditto. * tree-cfg.c (tree_duplicate_sese_region): Change doms to vector. Add argument to iterate_fix_dominators call. (remove_edge_and_dominated_blocks): Pass vector to bbs_to_fix_dom. * gcse.c (hoist_code): Change domby to vector. * cfghooks.c (make_forwarder_block): Change doms_to_fix to vector. Add argument to iterate_fix_dominators call. * loop-doloop.c (doloop_modify): Changed recount_dominator to recompute_dominator. * lambda-code.c (perfect_nestify): Ditto. * cfgloopanal.c: Include graphds.h. (struct edge, struct vertex, struct graph, dump_graph, new_graph, add_edge, dfs, for_each_edge, free_graph): Moved to graphds.c. (mark_irreducible_loops): Use graphds_scc. Remove argument from add_edge call. * graphds.c: New file. * graphds.h: New file. * dominance.c: Include vecprim.h, pointer-set.h and graphds.h. (get_dominated_by, get_dominated_by_region): Change return type to vector. (verify_dominators): Recompute all dominators and compare the results. (recount_dominator): Renamed to ... (recompute_dominator): ... this. Do not check that the block is dominated by entry. (iterate_fix_dominators): Reimplemented. (prune_bbs_to_update_dominators, root_of_dom_tree, determine_dominators_for_sons): New functions. * et-forest.c (et_root): New function. * et-forest.h (et_root): Declare. * Makefile.in (graphds.o): Add. (cfgloopanal.o): Add graphds.h dependency. (dominance.o): Add graphds.h, vecprim.h and pointer-set.h dependency. * basic-block.h (get_dominated_by, get_dominated_by_region, iterate_fix_dominators): Declaration changed. (recount_dominator): Renamed to ... (recompute_dominator): ... this. * tree-ssa-threadupdate.c (thread_block): Free dominance info. (thread_through_all_blocks): Do not free dominance info. From-SVN: r125297
Diffstat (limited to 'gcc/graphds.h')
-rw-r--r--gcc/graphds.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/gcc/graphds.h b/gcc/graphds.h
new file mode 100644
index 0000000..2aad4b0
--- /dev/null
+++ b/gcc/graphds.h
@@ -0,0 +1,63 @@
+/* Graph representation.
+ Copyright (C) 2007
+ Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
+
+/* Structure representing edge of a graph. */
+
+struct edge
+{
+ int src, dest; /* Source and destination. */
+ struct edge *pred_next, *succ_next;
+ /* Next edge in predecessor and successor lists. */
+ void *data; /* Data attached to the edge. */
+};
+
+/* Structure representing vertex of a graph. */
+
+struct vertex
+{
+ struct edge *pred, *succ;
+ /* Lists of predecessors and successors. */
+ int component; /* Number of dfs restarts before reaching the
+ vertex. */
+ int post; /* Postorder number. */
+ void *data; /* Data attached to the vertex. */
+};
+
+/* Structure representing a graph. */
+
+struct graph
+{
+ int n_vertices; /* Number of vertices. */
+ struct vertex *vertices;
+ /* The vertices. */
+};
+
+struct graph *new_graph (int);
+void dump_graph (FILE *, struct graph *);
+struct edge *add_edge (struct graph *, int, int);
+void identify_vertices (struct graph *, int, int);
+int graphds_dfs (struct graph *, int *, int,
+ VEC (int, heap) **, bool, bitmap);
+int graphds_scc (struct graph *, bitmap);
+void graphds_domtree (struct graph *, int, int *, int *, int *);
+typedef void (*graphds_edge_callback) (struct graph *, struct edge *);
+void for_each_edge (struct graph *, graphds_edge_callback);
+void free_graph (struct graph *g);