tree-hash-traits.h (tree_hash): New class.
authorRichard Sandiford <richard.sandiford@arm.com>
Thu, 25 Jun 2015 17:16:15 +0000 (17:16 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Thu, 25 Jun 2015 17:16:15 +0000 (17:16 +0000)
gcc/
* tree-hash-traits.h (tree_hash): New class.
* except.c: Include tree-hash-traits.h.
(tree_hash_traits): Use tree_hash.

From-SVN: r224970

gcc/ChangeLog
gcc/except.c
gcc/tree-hash-traits.h

index f95f2dcc9470a1ba20e5025d433d66adb0644251..6389191c1330f678d652e1c8bb5b562980d94374 100644 (file)
@@ -1,3 +1,9 @@
+2015-06-25  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * tree-hash-traits.h (tree_hash): New class.
+       * except.c: Include tree-hash-traits.h.
+       (tree_hash_traits): Use tree_hash.
+
 2015-06-25  Richard Sandiford  <richard.sandiford@arm.com>
 
        * tree-hash-traits.h (tree_ssa_name_hasher): New class.
index ce1e31f0645b08a18b9779c85d745ac6cfed671c..081b402fc50ab89604a59abec9bb6c01dafc93d3 100644 (file)
@@ -159,14 +159,11 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-pass.h"
 #include "cfgloop.h"
 #include "builtins.h"
+#include "tree-hash-traits.h"
 
 static GTY(()) int call_site_base;
 
-struct tree_hash_traits : default_hashmap_traits
-{
-  static hashval_t hash (tree t) { return TREE_HASH (t); }
-};
-
+struct tree_hash_traits : simple_hashmap_traits <tree_hash> {};
 static GTY (()) hash_map<tree, tree, tree_hash_traits> *type_to_runtime_map;
 
 /* Describe the SjLj_Function_Context structure.  */
index 1f4364f591e5aad055ab91751e16767d96c07145..1edc49eda46748648d263a2cfefce8c5f3aa567b 100644 (file)
@@ -67,4 +67,16 @@ tree_ssa_name_hash::hash (tree t)
   return SSA_NAME_VERSION (t);
 }
 
+/* Hasher for general trees, based on their TREE_HASH.  */
+struct tree_hash : ggc_ptr_hash <tree_node>
+{
+  static hashval_t hash (tree);
+};
+
+inline hashval_t
+tree_hash::hash (tree t)
+{
+  return TREE_HASH (t);
+}
+
 #endif