summaryrefslogtreecommitdiff
path: root/gcc/dse.c
diff options
context:
space:
mode:
authorcrowl <crowl@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-25 21:45:28 +0000
committercrowl <crowl@138bc75d-0d04-0410-961f-82ee72b054a4>2012-10-25 21:45:28 +0000
commitc580da876e6aea7485467ca8e3d19377ecba4fc7 (patch)
tree723cd03031244c4befb8e0f3f168067dec16d361 /gcc/dse.c
parent2e8d2f3202c34da752b421f1f78edff2325503e9 (diff)
downloadgcc-c580da876e6aea7485467ca8e3d19377ecba4fc7.tar.gz
Change hash_table to support a comparator type different from the
value type stored in the hash table. The 'find' functions now may take a different type from the value type. This requires introducing a second typedef into the Descriptor conceptual type. Change the Descriptor concept to use typedefs value_type and compare_type instead of T. Change all users to match. Add usage documentation to hash-table.h. Tested on x86-64. Index: gcc/ChangeLog 2012-10-25 Lawrence Crowl <crowl@google.com> * hash-table.h: Add usage documentation. (template struct typed_free_remove): Clarify documentation. Rename template parameter. (struct typed_noop_remove): Likewise. (descriptor concept): Change typedef T to value_type. Add typedef compare_type. Use more precise template parameter name, Descriptor instead of Descr. Update users to match. (struct hash_table): Change 'find' parameters to use compare_type instead of the value type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192823 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dse.c')
-rw-r--r--gcc/dse.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/dse.c b/gcc/dse.c
index 631a1f20ac7..3ae8353770f 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -654,19 +654,21 @@ clear_alias_set_lookup (alias_set_type alias_set)
struct invariant_group_base_hasher : typed_noop_remove <group_info>
{
- typedef group_info T;
- static inline hashval_t hash (const T *);
- static inline bool equal (const T *, const T *);
+ typedef group_info value_type;
+ typedef group_info compare_type;
+ static inline hashval_t hash (const value_type *);
+ static inline bool equal (const value_type *, const compare_type *);
};
inline bool
-invariant_group_base_hasher::equal (const T *gi1, const T *gi2)
+invariant_group_base_hasher::equal (const value_type *gi1,
+ const compare_type *gi2)
{
return rtx_equal_p (gi1->rtx_base, gi2->rtx_base);
}
inline hashval_t
-invariant_group_base_hasher::hash (const T *gi)
+invariant_group_base_hasher::hash (const value_type *gi)
{
int do_not_record;
return hash_rtx (gi->rtx_base, Pmode, &do_not_record, NULL, false);