aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-threadupdate.c
diff options
context:
space:
mode:
authorLawrence Crowl <crowl@google.com>2012-10-25 21:45:28 +0000
committerLawrence Crowl <crowl@gcc.gnu.org>2012-10-25 21:45:28 +0000
commit5831a5f0a8393c05a6da99f9a5995ffc7aa6b8ca (patch)
tree723cd03031244c4befb8e0f3f168067dec16d361 /gcc/tree-ssa-threadupdate.c
parent2257bc19401e4dfd76f199fa40c0aa6c3bfdc612 (diff)
downloadgcc-5831a5f0a8393c05a6da99f9a5995ffc7aa6b8ca.zip
gcc-5831a5f0a8393c05a6da99f9a5995ffc7aa6b8ca.tar.gz
gcc-5831a5f0a8393c05a6da99f9a5995ffc7aa6b8ca.tar.bz2
Change hash_table to support a comparator type different from the value type stored in the hash table.
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. From-SVN: r192823
Diffstat (limited to 'gcc/tree-ssa-threadupdate.c')
-rw-r--r--gcc/tree-ssa-threadupdate.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c
index ad64876..eca88a9 100644
--- a/gcc/tree-ssa-threadupdate.c
+++ b/gcc/tree-ssa-threadupdate.c
@@ -127,20 +127,21 @@ struct redirection_data : typed_free_remove<redirection_data>
struct el *incoming_edges;
/* hash_table support. */
- typedef redirection_data T;
- static inline hashval_t hash (const redirection_data *);
- static inline int equal (const redirection_data *, const redirection_data *);
+ typedef redirection_data value_type;
+ typedef redirection_data compare_type;
+ static inline hashval_t hash (const value_type *);
+ static inline int equal (const value_type *, const compare_type *);
};
inline hashval_t
-redirection_data::hash (const redirection_data *p)
+redirection_data::hash (const value_type *p)
{
edge e = p->outgoing_edge;
return e->dest->index;
}
inline int
-redirection_data::equal (const redirection_data *p1, const redirection_data *p2)
+redirection_data::equal (const value_type *p1, const compare_type *p2)
{
edge e1 = p1->outgoing_edge;
edge e2 = p2->outgoing_edge;