#include "calls.h"
#include "predict.h"
#include "basic-block.h"
-#include "plugin-api.h"
#include "hard-reg-set.h"
#include "function.h"
-#include "ipa-ref.h"
#include "cgraph.h"
#include "rtl.h"
#include "flags.h"
tree second;
} type_pair;
-struct pair_traits : default_hashset_traits
+template <>
+struct default_hash_traits <type_pair> : typed_noop_remove <type_pair>
{
+ typedef type_pair value_type;
+ typedef type_pair compare_type;
static hashval_t
hash (type_pair p)
{
};
static bool odr_types_equivalent_p (tree, tree, bool, bool *,
- hash_set<type_pair,pair_traits> *,
+ hash_set<type_pair> *,
location_t, location_t);
static bool odr_violation_reported = false;
/* Hash used to unify ODR types based on their mangled name and for anonymous
namespace types. */
-struct odr_name_hasher
+struct odr_name_hasher : pointer_hash <odr_type_d>
{
- typedef odr_type_d *value_type;
typedef union tree_node *compare_type;
static inline hashval_t hash (const odr_type_d *);
static inline bool equal (const odr_type_d *, const tree_node *);
static bool
odr_subtypes_equivalent_p (tree t1, tree t2,
- hash_set<type_pair,pair_traits> *visited,
+ hash_set<type_pair> *visited,
location_t loc1, location_t loc2)
{
static bool
odr_types_equivalent_p (tree t1, tree t2, bool warn, bool *warned,
- hash_set<type_pair,pair_traits> *visited,
+ hash_set<type_pair> *visited,
location_t loc1, location_t loc2)
{
/* Check first for the obvious case of pointer identity. */
bool
odr_types_equivalent_p (tree type1, tree type2)
{
- hash_set<type_pair,pair_traits> visited;
+ hash_set<type_pair> visited;
#ifdef ENABLE_CHECKING
gcc_assert (odr_or_derived_type_p (type1) && odr_or_derived_type_p (type2));
}
if (prevail)
- {
- tree tmp = type;
-
- type = val->type;
- val->type = tmp;
- }
+ std::swap (val->type, type);
val->types_set->add (type);
bool base_mismatch = false;
unsigned int i;
bool warned = false;
- hash_set<type_pair,pair_traits> visited;
+ hash_set<type_pair> visited;
gcc_assert (in_lto_p);
vec_safe_push (val->types, type);
/* Polymorphic call target cache helpers. */
-struct polymorphic_call_target_hasher
+struct polymorphic_call_target_hasher
+ : pointer_hash <polymorphic_call_target_d>
{
- typedef polymorphic_call_target_d *value_type;
- typedef polymorphic_call_target_d *compare_type;
static inline hashval_t hash (const polymorphic_call_target_d *);
static inline bool equal (const polymorphic_call_target_d *,
const polymorphic_call_target_d *);