This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [12/13] Reuse hash_table traits for hash_set


On 06/16/2015 03:14 AM, Richard Sandiford wrote:
This is the main patch, to reuse the hash_table traits for hash_set.
The idea is to replace the untemplated default_hashset_traits with a
templated default_hash_traits, which gives the default traits for a
given type.  This allows things like hash_set<void *> to continue
to work.

For now I've left default_hash_traits without a default implementation.
It could instead be defined to inherit its argument, so that hash_set
<free_ptr_hash <foo> > would work.  I didn't do that because I don't
have a use case, but it seems like a reasonably clean approach if
needed.

gcc/
	* hash-traits.h (default_hash_traits): New structure.
	* hash-set.h (default_hashset_traits): Delete.
	(hash_set): Use default_hash_traits<Key> instead of
	default_hashset_traits.  Delete hash_entry type and use Key directly.
	* ipa-devirt.c (pair_traits): Delete.
	(default_hash_traits <type_pair>): Override.
	(odr_subtypes_equivalent_p): Remove pair_types template parameter.
	(odr_types_equivalent_p, add_type_duplicate): Likewise.
OK.  Obviously dependent on prerequisites.

Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]