summaryrefslogtreecommitdiff
path: root/gcc/cp/cp-objcp-common.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-02 19:49:21 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-02 19:49:21 +0000
commitcc194b6e3a0bb9be324e211b2f5011ba34653d1e (patch)
treed84b06f0fdeaa66af08574dc1b752fda3c962abf /gcc/cp/cp-objcp-common.c
parent7199a4db5a77307767946a491630411553031389 (diff)
downloadgcc-cc194b6e3a0bb9be324e211b2f5011ba34653d1e.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160185 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/cp-objcp-common.c')
-rw-r--r--gcc/cp/cp-objcp-common.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/gcc/cp/cp-objcp-common.c b/gcc/cp/cp-objcp-common.c
index 460f32fe13d..35654c5f07a 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 <zlaski@apple.com>
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);
}