summaryrefslogtreecommitdiff
path: root/gcc/pointer-set.h
diff options
context:
space:
mode:
authoraustern <austern@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-14 23:15:29 +0000
committeraustern <austern@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-14 23:15:29 +0000
commitc6224531a4d142294fa7f14edb1f8b082208e3e1 (patch)
tree13188816247ecd269d6b10ee75c260da51a89ff6 /gcc/pointer-set.h
parenteb942953186969e85c709e87d3a3ad3ac0c8a13b (diff)
downloadgcc-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/pointer-set.h')
-rw-r--r--gcc/pointer-set.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/pointer-set.h b/gcc/pointer-set.h
new file mode 100644
index 00000000000..65ac9ee4724
--- /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 */