diff options
author | Jason Merrill <jason@redhat.com> | 2022-01-27 10:53:07 -0500 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2022-02-01 14:14:12 -0500 |
commit | b649071d4b3490aa43c6c2212312ace304c9ff1c (patch) | |
tree | 727dd53672950c787bdc7a75f8a27c42b3494707 | |
parent | f32f74c2e8cef5fe37af6d4e8d7e8f6b4c8ae9a8 (diff) | |
download | gcc-b649071d4b3490aa43c6c2212312ace304c9ff1c.zip gcc-b649071d4b3490aa43c6c2212312ace304c9ff1c.tar.gz gcc-b649071d4b3490aa43c6c2212312ace304c9ff1c.tar.bz2 |
tree: move tree_vec_map_cache_hasher into header
gcc/ChangeLog:
* tree.h (struct tree_vec_map_cache_hasher): Move from...
* tree.cc (struct tree_vec_map_cache_hasher): ...here.
-rw-r--r-- | gcc/tree.cc | 17 | ||||
-rw-r--r-- | gcc/tree.h | 17 |
2 files changed, 17 insertions, 17 deletions
diff --git a/gcc/tree.cc b/gcc/tree.cc index 9d445b2..7ce4f24 100644 --- a/gcc/tree.cc +++ b/gcc/tree.cc @@ -242,23 +242,6 @@ static GTY ((cache)) static GTY ((cache)) hash_table<tree_decl_map_cache_hasher> *value_expr_for_decl; -struct tree_vec_map_cache_hasher : ggc_cache_ptr_hash<tree_vec_map> -{ - static hashval_t hash (tree_vec_map *m) { return DECL_UID (m->base.from); } - - static bool - equal (tree_vec_map *a, tree_vec_map *b) - { - return a->base.from == b->base.from; - } - - static int - keep_cache_entry (tree_vec_map *&m) - { - return ggc_marked_p (m->base.from); - } -}; - static GTY ((cache)) hash_table<tree_vec_map_cache_hasher> *debug_args_for_decl; @@ -5559,6 +5559,23 @@ struct tree_decl_map_cache_hasher : ggc_cache_ptr_hash<tree_decl_map> #define tree_vec_map_hash tree_decl_map_hash #define tree_vec_map_marked_p tree_map_base_marked_p +struct tree_vec_map_cache_hasher : ggc_cache_ptr_hash<tree_vec_map> +{ + static hashval_t hash (tree_vec_map *m) { return DECL_UID (m->base.from); } + + static bool + equal (tree_vec_map *a, tree_vec_map *b) + { + return a->base.from == b->base.from; + } + + static int + keep_cache_entry (tree_vec_map *&m) + { + return ggc_marked_p (m->base.from); + } +}; + /* Hasher for tree decls. Pointer equality is enough here, but the DECL_UID is a better hash than the pointer value and gives a predictable traversal order. Additionally it can be used across PCH save/restore. */ |