diff options
author | austern <austern@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-14 23:15:29 +0000 |
---|---|---|
committer | austern <austern@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-14 23:15:29 +0000 |
commit | c6224531a4d142294fa7f14edb1f8b082208e3e1 (patch) | |
tree | 13188816247ecd269d6b10ee75c260da51a89ff6 /gcc/cgraphunit.c | |
parent | eb942953186969e85c709e87d3a3ad3ac0c8a13b (diff) | |
download | gcc-c6224531a4d142294fa7f14edb1f8b082208e3e1.tar.gz |
Speed up walk_tree by introducing a special-purpose hash table.
* pointer-set.c: New file, special-purpose hash table.
* pointer-set.h: New file.
* tree.h (struct pointer_set_t): Declare as opaque type.
(tree_walk): Last argument is pointer_set_t* now.
* tree-inline.c (WALK_SUBTREE): Convert from htab to pset.
(walk_type_fields):
(walk_tree): Convert from htab_t to pointer_set_t for keeping
track of which nodes have already been visited.
(walk_tree_without_duplicates): Convert from htab_t to pointer_set_t.
* cgraphunit.c (cgraph_create_edges): Likewise.
(cgraph_characterize_statics_local): Likewise.
* tree-dfa.c (collect_dfa_stats): Likewise.
* langhooks-def.h (lhd_tree_inlining_walk_subtrees): Last arg is
pointer_set_t* now.
* langhooks.c (lhd_tree_inlining_walk_subtrees): Likewise.
* langhooks.h (struct lang_hooks_for_tree_inlining): Last arg type
of walk_subtrees is pointer_set_t* now.
* Makefile.in (OBJS-common): add pointer-set.o
(tree-inline.o): Depends on pointer-set.h
(tree-dfa.o): Likewise
(cgraphunit.o): Likewise
* cp/Make-lang.in (pt.o): depends on pointer-set.h
* cp/cp-tree.h (cp_walk_subtrees): Last argument is pointer_set_t* now.
* cp/pt.c (struct pair_fn_data): Use pointer_set_t, not htab_t
(for_each_template_parm): Convert from htab_t to pointer_set_t.
* cp/tree.c (cp_walk_subtrees): Last argument is pointer_set_t* now.
* java/lang.c (java_tree_inlining_walk_subtrees): Last arg is struct
pointer_set_t* now.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89062 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r-- | gcc/cgraphunit.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 5d0a32faad6..e942aada193 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -186,7 +186,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "tree-flow.h" #include "tree-inline.h" #include "langhooks.h" -#include "hashtab.h" +#include "pointer-set.h" #include "toplev.h" #include "flags.h" #include "ggc.h" @@ -223,7 +223,7 @@ static int overall_insns; walk_tree_without_duplicates doesn't guarantee each node is visited once because it gets a new htab upon each recursive call from record_calls_1. */ -static htab_t visited_nodes; +static struct pointer_set_t *visited_nodes; static FILE *cgraph_dump_file; @@ -698,10 +698,9 @@ cgraph_create_edges (struct cgraph_node *node, tree body) { /* The nodes we're interested in are never shared, so walk the tree ignoring duplicates. */ - visited_nodes = htab_create (37, htab_hash_pointer, - htab_eq_pointer, NULL); + visited_nodes = pointer_set_create (); walk_tree (&body, record_call_1, node, visited_nodes); - htab_delete (visited_nodes); + pointer_set_destroy (visited_nodes); visited_nodes = NULL; } @@ -2288,8 +2287,7 @@ cgraph_characterize_statics_local (struct cgraph_node *fn) /* The nodes we're interested in are never shared, so walk the tree ignoring duplicates. */ - visited_nodes = htab_create (37, htab_hash_pointer, - htab_eq_pointer, NULL); + visited_nodes = pointer_set_create (); /* FIXME -- PROFILE-RESTRUCTURE: Remove creation of _decl_uid vars. */ l->statics_read_by_decl_uid = BITMAP_GGC_ALLOC (); @@ -2299,7 +2297,7 @@ cgraph_characterize_statics_local (struct cgraph_node *fn) fprintf (cgraph_dump_file, "\n local analysis of %s", cgraph_node_name (fn)); walk_tree (&DECL_SAVED_TREE (decl), scan_for_static_refs, fn, visited_nodes); - htab_delete (visited_nodes); + pointer_set_destroy (visited_nodes); visited_nodes = NULL; } |