Wunused-parameter warnings are given from cgraph::finalize_function,
[gcc.git] / gcc / ipa-devirt.c
index 1bf4b1acb6b401b468f41c344575a67bc06802b2..905776e0a0cbbcfe29488063d0b5d70c12a77825 100644 (file)
@@ -117,10 +117,8 @@ along with GCC; see the file COPYING3.  If not see
 #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"
@@ -162,8 +160,11 @@ typedef struct
   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)
   {
@@ -192,7 +193,7 @@ struct pair_traits : default_hashset_traits
 };
 
 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;
@@ -383,9 +384,8 @@ type_possibly_instantiated_p (tree t)
 /* 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 *);
@@ -770,7 +770,7 @@ set_type_binfo (tree type, tree binfo)
 
 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)
 {
 
@@ -1336,7 +1336,7 @@ warn_types_mismatch (tree t1, tree t2, 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.  */
@@ -1786,7 +1786,7 @@ odr_types_equivalent_p (tree t1, tree t2, bool warn, bool *warned,
 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));
@@ -1861,7 +1861,7 @@ add_type_duplicate (odr_type val, tree 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);
@@ -2724,10 +2724,9 @@ struct polymorphic_call_target_d
 
 /* 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 *);