Commit 843adf88 by Richard Sandiford Committed by Richard Sandiford

gcc/

	* hash-traits.h (pointer_hash::mark_deleted, pointer_hash::mark_empty)
	(pointer_hash::is_deleted, pointer_hash::is_empty): New functions.

From-SVN: r224956
parent 5ac6389b
2015-06-25 Richard Sandiford <richard.sandiford@arm.com>
* hash-traits.h (pointer_hash::mark_deleted, pointer_hash::mark_empty)
(pointer_hash::is_deleted, pointer_hash::is_empty): New functions.
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
......
......@@ -66,9 +66,12 @@ struct pointer_hash : typed_noop_remove <Type>
typedef Type *compare_type;
static inline hashval_t hash (const value_type &);
static inline bool equal (const value_type &existing,
const compare_type &candidate);
static inline void mark_deleted (Type *&);
static inline void mark_empty (Type *&);
static inline bool is_deleted (Type *);
static inline bool is_empty (Type *);
};
template <typename Type>
......@@ -88,6 +91,34 @@ pointer_hash <Type>::equal (const value_type &existing,
return existing == candidate;
}
template <typename Type>
inline void
pointer_hash <Type>::mark_deleted (Type *&e)
{
e = reinterpret_cast<Type *> (1);
}
template <typename Type>
inline void
pointer_hash <Type>::mark_empty (Type *&e)
{
e = NULL;
}
template <typename Type>
inline bool
pointer_hash <Type>::is_deleted (Type *e)
{
return e == reinterpret_cast<Type *> (1);
}
template <typename Type>
inline bool
pointer_hash <Type>::is_empty (Type *e)
{
return e == NULL;
}
/* Hasher for entry in gc memory. */
template<typename T>
......
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