diff options
Diffstat (limited to 'gcc/cselib.c')
-rw-r--r-- | gcc/cselib.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/cselib.c b/gcc/cselib.c index d6ccbfb4690..30845edb4f6 100644 --- a/gcc/cselib.c +++ b/gcc/cselib.c @@ -102,8 +102,8 @@ static rtx cselib_expand_value_rtx_1 (rtx, struct expand_value_data *, int); struct cselib_hasher : typed_noop_remove <cselib_val> { - typedef cselib_val value_type; - struct compare_type { + typedef cselib_val *value_type; + struct key { /* The rtx value and its mode (needed separately for constant integers). */ machine_mode mode; @@ -111,8 +111,9 @@ struct cselib_hasher : typed_noop_remove <cselib_val> /* The mode of the contaning MEM, if any, otherwise VOIDmode. */ machine_mode memmode; }; - static inline hashval_t hash (const value_type *); - static inline bool equal (const value_type *, const compare_type *); + typedef key *compare_type; + static inline hashval_t hash (const cselib_val *); + static inline bool equal (const cselib_val *, const key *); }; /* The hash function for our hash table. The value is always computed with @@ -120,7 +121,7 @@ struct cselib_hasher : typed_noop_remove <cselib_val> hash value from a cselib_val structure. */ inline hashval_t -cselib_hasher::hash (const value_type *v) +cselib_hasher::hash (const cselib_val *v) { return v->hash; } @@ -131,7 +132,7 @@ cselib_hasher::hash (const value_type *v) CONST of an appropriate mode. */ inline bool -cselib_hasher::equal (const value_type *v, const compare_type *x_arg) +cselib_hasher::equal (const cselib_val *v, const key *x_arg) { struct elt_loc_list *l; rtx x = x_arg->x; @@ -507,7 +508,7 @@ preserve_constants_and_equivs (cselib_val **x, void *info ATTRIBUTE_UNUSED) if (invariant_or_equiv_p (v)) { - cselib_hasher::compare_type lookup = { + cselib_hasher::key lookup = { GET_MODE (v->val_rtx), v->val_rtx, VOIDmode }; cselib_val **slot @@ -592,7 +593,7 @@ cselib_find_slot (machine_mode mode, rtx x, hashval_t hash, enum insert_option insert, machine_mode memmode) { cselib_val **slot = NULL; - cselib_hasher::compare_type lookup = { mode, x, memmode }; + cselib_hasher::key lookup = { mode, x, memmode }; if (cselib_preserve_constants) slot = cselib_preserved_hash_table->find_slot_with_hash (&lookup, hash, NO_INSERT); |