hash-traits.h (ggc_hasher::remove): Take a reference parameter.

gcc/
	* hash-traits.h (ggc_hasher::remove): Take a reference parameter.
	(ggc_hasher::ggc_mx): Likewise.
	(ggc_cache_hasher): Inherit from ggc_hasher.  Remove definitions
	that duplicate ggc_hasher ones.

From-SVN: r224955
This commit is contained in:
Richard Sandiford 2015-06-25 17:05:55 +00:00 committed by Richard Sandiford
parent 08ec27543d
commit 5ac6389bc1
2 changed files with 10 additions and 22 deletions

View file

@ -1,3 +1,10 @@
2015-06-25 Richard Sandiford <richard.sandiford@arm.com>
* hash-traits.h (ggc_hasher::remove): Take a reference parameter.
(ggc_hasher::ggc_mx): Likewise.
(ggc_cache_hasher): Inherit from ggc_hasher. Remove definitions
that duplicate ggc_hasher ones.
2015-06-25 Richard Sandiford <richard.sandiford@arm.com>
* hash-table.h (hash_table): Add gt_cleare_cache as a friend.

View file

@ -96,10 +96,10 @@ struct ggc_hasher
typedef T value_type;
typedef T compare_type;
static void remove (T) {}
static void remove (T &) {}
static void
ggc_mx (T p)
ggc_mx (T &p)
{
extern void gt_ggc_mx (T &);
gt_ggc_mx (p);
@ -122,30 +122,11 @@ struct ggc_hasher
/* Hasher for cache entry in gc memory. */
template<typename T>
struct ggc_cache_hasher
struct ggc_cache_hasher : ggc_hasher<T>
{
typedef T value_type;
typedef T compare_type;
static void remove (T &) {}
/* Entries are weakly held because this is for caches. */
static void ggc_mx (T &) {}
static void
pch_nx (T &p)
{
extern void gt_pch_nx (T &);
gt_pch_nx (p);
}
static void
pch_nx (T &p, gt_pointer_operator op, void *cookie)
{
op (&p, cookie);
}
static int
keep_cache_entry (T &e)
{