diff options
author | Andi Kleen <ak@linux.intel.com> | 2014-08-01 02:52:19 +0000 |
---|---|---|
committer | Andi Kleen <ak@gcc.gnu.org> | 2014-08-01 02:52:19 +0000 |
commit | d313d45fe1f4eb419affc4f29c5ea32608f1e5e3 (patch) | |
tree | 9b8fefff23ea64980eb8e9810a325a2d2edac6e5 /gcc | |
parent | 1a4d88510615ca2c8aececb55abf0226c7803613 (diff) | |
download | gcc-d313d45fe1f4eb419affc4f29c5ea32608f1e5e3.zip gcc-d313d45fe1f4eb419affc4f29c5ea32608f1e5e3.tar.gz gcc-d313d45fe1f4eb419affc4f29c5ea32608f1e5e3.tar.bz2 |
Convert ipa-devirt to inchash
gcc/:
2014-07-31 Andi Kleen <ak@linux.intel.com>
* ipa-devirt.c (polymorphic_call_target_hasher::hash):
Convert to inchash.
From-SVN: r213397
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ipa-devirt.c | 27 |
2 files changed, 17 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 641a78b..543acf9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2014-07-31 Andi Kleen <ak@linux.intel.com> + * ipa-devirt.c (polymorphic_call_target_hasher::hash): + Convert to inchash. + +2014-07-31 Andi Kleen <ak@linux.intel.com> + * asan.c (asan_mem_ref_hasher::hash): Convert to inchash. 2014-07-31 Andi Kleen <ak@linux.intel.com> diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c index 1c6d19d..f79653a 100644 --- a/gcc/ipa-devirt.c +++ b/gcc/ipa-devirt.c @@ -1635,25 +1635,22 @@ struct polymorphic_call_target_hasher inline hashval_t polymorphic_call_target_hasher::hash (const value_type *odr_query) { - hashval_t hash; + inchash::hash hstate (odr_query->otr_token); + + hstate.add_wide_int (odr_query->type->id); + hstate.merge_hash (TYPE_UID (odr_query->context.outer_type)); + hstate.add_wide_int (odr_query->context.offset); - hash = iterative_hash_host_wide_int - (odr_query->otr_token, - odr_query->type->id); - hash = iterative_hash_hashval_t (TYPE_UID (odr_query->context.outer_type), - hash); - hash = iterative_hash_host_wide_int (odr_query->context.offset, hash); if (odr_query->context.speculative_outer_type) { - hash = iterative_hash_hashval_t - (TYPE_UID (odr_query->context.speculative_outer_type), hash); - hash = iterative_hash_host_wide_int (odr_query->context.speculative_offset, - hash); + hstate.merge_hash (TYPE_UID (odr_query->context.speculative_outer_type)); + hstate.add_wide_int (odr_query->context.speculative_offset); } - return iterative_hash_hashval_t - (((int)odr_query->context.maybe_in_construction << 2) - | ((int)odr_query->context.speculative_maybe_derived_type << 1) - | (int)odr_query->context.maybe_derived_type, hash); + hstate.add_flag (odr_query->context.maybe_in_construction); + hstate.add_flag (odr_query->context.maybe_derived_type); + hstate.add_flag (odr_query->context.speculative_maybe_derived_type); + hstate.commit_flag (); + return hstate.end (); } /* Compare cache entries T1 and T2. */ |