Commit 5ac6389b by Richard Sandiford Committed by Richard Sandiford

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
parent 08ec2754
2015-06-25 Richard Sandiford <richard.sandiford@arm.com> 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. * hash-table.h (hash_table): Add gt_cleare_cache as a friend.
(gt_cleare_cache): Check here for deleted and empty entries. (gt_cleare_cache): Check here for deleted and empty entries.
Replace handle_cache_entry with a call to keep_cache_entry. Replace handle_cache_entry with a call to keep_cache_entry.
......
...@@ -96,10 +96,10 @@ struct ggc_hasher ...@@ -96,10 +96,10 @@ struct ggc_hasher
typedef T value_type; typedef T value_type;
typedef T compare_type; typedef T compare_type;
static void remove (T) {} static void remove (T &) {}
static void static void
ggc_mx (T p) ggc_mx (T &p)
{ {
extern void gt_ggc_mx (T &); extern void gt_ggc_mx (T &);
gt_ggc_mx (p); gt_ggc_mx (p);
...@@ -122,30 +122,11 @@ struct ggc_hasher ...@@ -122,30 +122,11 @@ struct ggc_hasher
/* Hasher for cache entry in gc memory. */ /* Hasher for cache entry in gc memory. */
template<typename T> 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. */ /* Entries are weakly held because this is for caches. */
static void ggc_mx (T &) {} 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 static int
keep_cache_entry (T &e) keep_cache_entry (T &e)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment