diff options
Diffstat (limited to 'gcc/tree-hash-traits.h')
-rw-r--r-- | gcc/tree-hash-traits.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/tree-hash-traits.h b/gcc/tree-hash-traits.h index 9a2fda7..1f4364f 100644 --- a/gcc/tree-hash-traits.h +++ b/gcc/tree-hash-traits.h @@ -53,4 +53,18 @@ tree_decl_hash::hash (tree t) return DECL_UID (t); } +/* Hash for SSA_NAMEs in the same function. Pointer equality is enough + here, but the SSA_NAME_VERSION is a better hash than the pointer + value and gives a predictable traversal order. */ +struct tree_ssa_name_hash : ggc_ptr_hash <tree_node> +{ + static inline hashval_t hash (tree); +}; + +inline hashval_t +tree_ssa_name_hash::hash (tree t) +{ + return SSA_NAME_VERSION (t); +} + #endif |