diff options
author | rakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-03 19:10:44 +0000 |
---|---|---|
committer | rakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-03 19:10:44 +0000 |
commit | 3f9439d71f45a5eb2d699fb5b6d819143031b5db (patch) | |
tree | 00a98b1b54819809ffb6999717d9263ac5558fe2 /gcc/graphds.h | |
parent | 604c77da256415c139a223b79136b93b64e5d2c5 (diff) | |
download | gcc-3f9439d71f45a5eb2d699fb5b6d819143031b5db.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125297 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/graphds.h')
-rw-r--r-- | gcc/graphds.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/gcc/graphds.h b/gcc/graphds.h new file mode 100644 index 00000000000..2aad4b00a73 --- /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); |