From 53e030f1439a414a0247a86fa76534f353558be4 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 2 Jun 2010 21:49:21 +0200 Subject: tree.h (struct tree_decl_map): New type. * tree.h (struct tree_decl_map): New type. (tree_decl_map_eq, tree_decl_map_marked_p): Define. (tree_decl_map_hash): New prototype. (debug_expr_for_decl, value_expr_for_decl): Change into tree_decl_map hashtab from tree_map. (init_ttree): Adjust initialization. (tree_decl_map_hash): New function. (decl_debug_expr_lookup, decl_debug_expr_insert, decl_value_expr_lookup, decl_value_expr_insert): Adjust. cp/ * cp-objcp-common.c (shadowed_var_for_decl): Change into tree_decl_map hashtab from tree_map. (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Adjust. (init_shadowed_var_for_decl): Adjust initialization. From-SVN: r160185 --- gcc/cp/ChangeLog | 7 +++++++ gcc/cp/cp-objcp-common.c | 24 ++++++++++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) (limited to 'gcc/cp') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 09bbe68..1dabc4c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2010-06-02 Jakub Jelinek + + * cp-objcp-common.c (shadowed_var_for_decl): Change into + tree_decl_map hashtab from tree_map. + (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Adjust. + (init_shadowed_var_for_decl): Adjust initialization. + 2010-06-02 Jason Merrill * error.c (dump_type): Improve typedef handling. diff --git a/gcc/cp/cp-objcp-common.c b/gcc/cp/cp-objcp-common.c index 460f32f..35654c5 100644 --- a/gcc/cp/cp-objcp-common.c +++ b/gcc/cp/cp-objcp-common.c @@ -1,5 +1,5 @@ /* Some code common to C++ and ObjC++ front ends. - Copyright (C) 2004, 2007, 2008, 2009 Free Software Foundation, Inc. + Copyright (C) 2004, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Ziemowit Laski This file is part of GCC. @@ -177,7 +177,7 @@ has_c_linkage (const_tree decl) return DECL_EXTERN_C_P (decl); } -static GTY ((if_marked ("tree_map_marked_p"), param_is (struct tree_map))) +static GTY ((if_marked ("tree_decl_map_marked_p"), param_is (struct tree_decl_map))) htab_t shadowed_var_for_decl; /* Lookup a shadowed var for FROM, and return it if we find one. */ @@ -185,11 +185,11 @@ static GTY ((if_marked ("tree_map_marked_p"), param_is (struct tree_map))) tree decl_shadowed_for_var_lookup (tree from) { - struct tree_map *h, in; + struct tree_decl_map *h, in; in.base.from = from; - h = (struct tree_map *) htab_find_with_hash (shadowed_var_for_decl, &in, - htab_hash_pointer (from)); + h = (struct tree_decl_map *) + htab_find_with_hash (shadowed_var_for_decl, &in, DECL_UID (from)); if (h) return h->to; return NULL_TREE; @@ -200,22 +200,22 @@ decl_shadowed_for_var_lookup (tree from) void decl_shadowed_for_var_insert (tree from, tree to) { - struct tree_map *h; + struct tree_decl_map *h; void **loc; - h = GGC_NEW (struct tree_map); - h->hash = htab_hash_pointer (from); + h = GGC_NEW (struct tree_decl_map); h->base.from = from; h->to = to; - loc = htab_find_slot_with_hash (shadowed_var_for_decl, h, h->hash, INSERT); - *(struct tree_map **) loc = h; + loc = htab_find_slot_with_hash (shadowed_var_for_decl, h, DECL_UID (from), + INSERT); + *(struct tree_decl_map **) loc = h; } void init_shadowed_var_for_decl (void) { - shadowed_var_for_decl = htab_create_ggc (512, tree_map_hash, - tree_map_eq, 0); + shadowed_var_for_decl = htab_create_ggc (512, tree_decl_map_hash, + tree_decl_map_eq, 0); } -- cgit v1.1