diff options
Diffstat (limited to 'gcc/cp/cp-objcp-common.c')
-rw-r--r-- | gcc/cp/cp-objcp-common.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/gcc/cp/cp-objcp-common.c b/gcc/cp/cp-objcp-common.c index 12df4c2..9457af2 100644 --- a/gcc/cp/cp-objcp-common.c +++ b/gcc/cp/cp-objcp-common.c @@ -178,8 +178,8 @@ has_c_linkage (const_tree decl) return DECL_EXTERN_C_P (decl); } -static GTY ((if_marked ("tree_decl_map_marked_p"), param_is (struct tree_decl_map))) - htab_t shadowed_var_for_decl; +static GTY ((cache)) + hash_table<tree_decl_map_cache_hasher> *shadowed_var_for_decl; /* Lookup a shadowed var for FROM, and return it if we find one. */ @@ -189,8 +189,7 @@ decl_shadowed_for_var_lookup (tree from) struct tree_decl_map *h, in; in.base.from = from; - h = (struct tree_decl_map *) - htab_find_with_hash (shadowed_var_for_decl, &in, DECL_UID (from)); + h = shadowed_var_for_decl->find_with_hash (&in, DECL_UID (from)); if (h) return h->to; return NULL_TREE; @@ -202,21 +201,18 @@ void decl_shadowed_for_var_insert (tree from, tree to) { struct tree_decl_map *h; - void **loc; h = ggc_alloc<tree_decl_map> (); h->base.from = from; h->to = to; - loc = htab_find_slot_with_hash (shadowed_var_for_decl, h, DECL_UID (from), - INSERT); - *(struct tree_decl_map **) loc = h; + *shadowed_var_for_decl->find_slot_with_hash (h, DECL_UID (from), INSERT) = h; } void init_shadowed_var_for_decl (void) { - shadowed_var_for_decl = htab_create_ggc (512, tree_decl_map_hash, - tree_decl_map_eq, 0); + shadowed_var_for_decl + = hash_table<tree_decl_map_cache_hasher>::create_ggc (512); } /* Return true if stmt can fall through. Used by block_may_fallthru |