diff options
author | Matt Austern <austern@apple.com> | 2004-10-14 23:15:29 +0000 |
---|---|---|
committer | Matt Austern <austern@gcc.gnu.org> | 2004-10-14 23:15:29 +0000 |
commit | 0c58f841a52644c9845b3c136f3264e6a728ba76 (patch) | |
tree | 13188816247ecd269d6b10ee75c260da51a89ff6 /gcc/pointer-set.h | |
parent | 5d1b2a1e421e770aba056e6b1405ed0eb29d29eb (diff) | |
download | gcc-0c58f841a52644c9845b3c136f3264e6a728ba76.zip gcc-0c58f841a52644c9845b3c136f3264e6a728ba76.tar.gz gcc-0c58f841a52644c9845b3c136f3264e6a728ba76.tar.bz2 |
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.
From-SVN: r89062
Diffstat (limited to 'gcc/pointer-set.h')
-rw-r--r-- | gcc/pointer-set.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/pointer-set.h b/gcc/pointer-set.h new file mode 100644 index 0000000..65ac9ee --- /dev/null +++ b/gcc/pointer-set.h @@ -0,0 +1,32 @@ +/* Set operations on pointers + Copyright (C) 2004 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, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ + +#ifndef POINTER_SET_H +#define POINTER_SET_H + +struct pointer_set_t; + +struct pointer_set_t *pointer_set_create (void); +void pointer_set_destroy (struct pointer_set_t *pset); + +int pointer_set_contains (struct pointer_set_t *pset, void *p); +int pointer_set_insert (struct pointer_set_t *pset, void *p); + +#endif /* POINTER_SET_H */ |