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.
This commit is contained in:
parent
f32f74c2e8
commit
b649071d4b
2 changed files with 17 additions and 17 deletions
17
gcc/tree.cc
17
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;
|
||||
|
||||
|
|
17
gcc/tree.h
17
gcc/tree.h
|
@ -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. */
|
||||
|
|
Loading…
Add table
Reference in a new issue