Commit 84a98514 by Richard Sandiford Committed by Richard Sandiford

tree-hash-traits.h (tree_hash): New class.

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
parent 5d6678ae
2015-06-25 Richard Sandiford <richard.sandiford@arm.com> 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. * tree-hash-traits.h (tree_ssa_name_hasher): New class.
* sese.c: Include tree-hash-traits.h. * sese.c: Include tree-hash-traits.h.
(rename_map_hasher): Use tree_ssa_name_hasher. (rename_map_hasher): Use tree_ssa_name_hasher.
......
...@@ -159,14 +159,11 @@ along with GCC; see the file COPYING3. If not see ...@@ -159,14 +159,11 @@ along with GCC; see the file COPYING3. If not see
#include "tree-pass.h" #include "tree-pass.h"
#include "cfgloop.h" #include "cfgloop.h"
#include "builtins.h" #include "builtins.h"
#include "tree-hash-traits.h"
static GTY(()) int call_site_base; static GTY(()) int call_site_base;
struct tree_hash_traits : default_hashmap_traits struct tree_hash_traits : simple_hashmap_traits <tree_hash> {};
{
static hashval_t hash (tree t) { return TREE_HASH (t); }
};
static GTY (()) hash_map<tree, tree, tree_hash_traits> *type_to_runtime_map; static GTY (()) hash_map<tree, tree, tree_hash_traits> *type_to_runtime_map;
/* Describe the SjLj_Function_Context structure. */ /* Describe the SjLj_Function_Context structure. */
......
...@@ -67,4 +67,16 @@ tree_ssa_name_hash::hash (tree t) ...@@ -67,4 +67,16 @@ tree_ssa_name_hash::hash (tree t)
return SSA_NAME_VERSION (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 #endif
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