aboutsummaryrefslogtreecommitdiff
path: root/gcc/sanopt.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2015-06-25 17:16:51 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2015-06-25 17:16:51 +0000
commit9654754bd9ab263c3d2a6e04bbd1a4dc36f9f280 (patch)
tree6728b4fcfe1d6d91859b5129fff9d1b8b4a755c0 /gcc/sanopt.c
parente0702244b8e0fa5555e20b5554545bab9d06927f (diff)
downloadgcc-9654754bd9ab263c3d2a6e04bbd1a4dc36f9f280.zip
gcc-9654754bd9ab263c3d2a6e04bbd1a4dc36f9f280.tar.gz
gcc-9654754bd9ab263c3d2a6e04bbd1a4dc36f9f280.tar.bz2
ipa-icf.h (symbol_compare_hash): New class.
gcc/ * ipa-icf.h (symbol_compare_hash): New class. (symbol_compare_hashmap_traits): Use it. * mem-stats.h (mem_alloc_description::mem_location_hash): New class. (mem_alloc_description::mem_alloc_hashmap_traits): Use it. (mem_alloc_description::reverse_mem_map_t): Remove redundant default_hashmap_traits. * sanopt.c (sanopt_tree_triplet_hash): New class. (sanopt_tree_triplet_map_traits): Use it. From-SVN: r224974
Diffstat (limited to 'gcc/sanopt.c')
-rw-r--r--gcc/sanopt.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/gcc/sanopt.c b/gcc/sanopt.c
index f0ca8e0..e8dfc5f 100644
--- a/gcc/sanopt.c
+++ b/gcc/sanopt.c
@@ -107,8 +107,11 @@ struct sanopt_tree_triplet
/* Traits class for tree triplet hash maps below. */
-struct sanopt_tree_triplet_map_traits : default_hashmap_traits
+struct sanopt_tree_triplet_hash : typed_noop_remove <sanopt_tree_triplet>
{
+ typedef sanopt_tree_triplet value_type;
+ typedef sanopt_tree_triplet compare_type;
+
static inline hashval_t
hash (const sanopt_tree_triplet &ref)
{
@@ -120,41 +123,39 @@ struct sanopt_tree_triplet_map_traits : default_hashmap_traits
}
static inline bool
- equal_keys (const sanopt_tree_triplet &ref1, const sanopt_tree_triplet &ref2)
+ equal (const sanopt_tree_triplet &ref1, const sanopt_tree_triplet &ref2)
{
return operand_equal_p (ref1.t1, ref2.t1, 0)
&& operand_equal_p (ref1.t2, ref2.t2, 0)
&& operand_equal_p (ref1.t3, ref2.t3, 0);
}
- template<typename T>
static inline void
- mark_deleted (T &e)
+ mark_deleted (sanopt_tree_triplet &ref)
{
- e.m_key.t1 = reinterpret_cast<T *> (1);
+ ref.t1 = reinterpret_cast<tree> (1);
}
- template<typename T>
static inline void
- mark_empty (T &e)
+ mark_empty (sanopt_tree_triplet &ref)
{
- e.m_key.t1 = NULL;
+ ref.t1 = NULL;
}
- template<typename T>
static inline bool
- is_deleted (T &e)
+ is_deleted (const sanopt_tree_triplet &ref)
{
- return e.m_key.t1 == (void *) 1;
+ return ref.t1 == (void *) 1;
}
- template<typename T>
static inline bool
- is_empty (T &e)
+ is_empty (const sanopt_tree_triplet &ref)
{
- return e.m_key.t1 == NULL;
+ return ref.t1 == NULL;
}
};
+typedef simple_hashmap_traits <sanopt_tree_triplet_hash>
+ sanopt_tree_triplet_map_traits;
/* This is used to carry various hash maps and variables used
in sanopt_optimize_walker. */