diff options
| author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-01-07 01:38:24 +0000 |
|---|---|---|
| committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-01-07 01:38:24 +0000 |
| commit | cfa03699ad2c88bd33f27aefe83f300608c2fcfd (patch) | |
| tree | 3f0fe00cae4569db3f7052e31734efcc4d4f4cf7 | |
| parent | 3c8d298d88b131918c2c8cbef1a40404cdaaa917 (diff) | |
| download | ppe42-gcc-cfa03699ad2c88bd33f27aefe83f300608c2fcfd.tar.gz ppe42-gcc-cfa03699ad2c88bd33f27aefe83f300608c2fcfd.zip | |
* pt.c (retrieve_local_specialization): Revert 2003-01-05 change.
(hash_local_specialization): New function.
(register_local_specialization): Revert 2003-01-05 change.
(instantiate_decl): Use hash_local_specialization when creating
the local_specializations table.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60971 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/cp/pt.c | 17 |
2 files changed, 20 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b1b1a7591d1..6e5e223d905 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,11 @@ 2003-01-06 Mark Mitchell <mark@codesourcery.com> + * pt.c (retrieve_local_specialization): Revert 2003-01-05 change. + (hash_local_specialization): New function. + (register_local_specialization): Revert 2003-01-05 change. + (instantiate_decl): Use hash_local_specialization when creating + the local_specializations table. + * decl2.c (mark_used): Do not synthesize thunks. * class.c (layout_class_type): Correct handling of unnamed diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 05e98266db2..f7a9114d7a8 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -745,7 +745,9 @@ static tree retrieve_local_specialization (tmpl) tree tmpl; { - tree spec = (tree) htab_find (local_specializations, tmpl); + tree spec = + (tree) htab_find_with_hash (local_specializations, tmpl, + htab_hash_pointer (tmpl)); return spec ? TREE_PURPOSE (spec) : NULL_TREE; } @@ -922,6 +924,14 @@ eq_local_specializations (const void *p1, const void *p2) return TREE_VALUE ((tree) p1) == (tree) p2; } +/* Hash P1, an entry in the local specializations table. */ + +static hashval_t +hash_local_specialization (const void* p1) +{ + return htab_hash_pointer (TREE_VALUE ((tree) p1)); +} + /* Like register_specialization, but for local declarations. We are registering SPEC, an instantiation of TMPL. */ @@ -932,7 +942,8 @@ register_local_specialization (spec, tmpl) { void **slot; - slot = htab_find_slot (local_specializations, tmpl, INSERT); + slot = htab_find_slot_with_hash (local_specializations, tmpl, + htab_hash_pointer (tmpl), INSERT); *slot = build_tree_list (spec, tmpl); } @@ -10308,7 +10319,7 @@ instantiate_decl (d, defer_ok) /* Set up the list of local specializations. */ local_specializations = htab_create (37, - htab_hash_pointer, + hash_local_specialization, eq_local_specializations, NULL); |

