aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-dfa.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2007-10-18 14:51:54 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2007-10-18 14:51:54 +0000
commit9fc5a389d68d7fbfc32d86f3ad7f631cb4fc634d (patch)
treee19ca8d69418bd88e8861decc26c8b195dde4b2f /gcc/tree-dfa.c
parent076a5ce626f254ae311ebc2db8e8d304194d23dd (diff)
downloadgcc-9fc5a389d68d7fbfc32d86f3ad7f631cb4fc634d.zip
gcc-9fc5a389d68d7fbfc32d86f3ad7f631cb4fc634d.tar.gz
gcc-9fc5a389d68d7fbfc32d86f3ad7f631cb4fc634d.tar.bz2
tree-flow.h (struct gimple_df): Make referenced_vars a uid_decl_map.
2007-10-18 Richard Guenther <rguenther@suse.de> * tree-flow.h (struct gimple_df): Make referenced_vars a uid_decl_map. (uid_decl_map_eq): Declare. (uid_decl_map_hash): Likewise. * tree-ssa.c (uid_decl_map_eq): New function. (uid_decl_map_hash): Likewise. (init_tree_ssa): Make referenced_vars a uid_decl_map. * tree-flow-inline.h (first_referenced_var): Deal with the referenced_vars representation change. (next_referenced_var): Likewise. * tree-dfa.c (referenced_var_lookup): Likewise. (referenced_var_check_and_insert): Likewise. (remove_referenced_var): Likewise. From-SVN: r129440
Diffstat (limited to 'gcc/tree-dfa.c')
-rw-r--r--gcc/tree-dfa.c34
1 files changed, 12 insertions, 22 deletions
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c
index e6b593e..26e87c1 100644
--- a/gcc/tree-dfa.c
+++ b/gcc/tree-dfa.c
@@ -635,14 +635,12 @@ find_vars_r (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
tree
referenced_var_lookup (unsigned int uid)
{
- struct int_tree_map *h, in;
+ tree h;
+ struct tree_decl_minimal in;
in.uid = uid;
- h = (struct int_tree_map *)
- htab_find_with_hash (gimple_referenced_vars (cfun), &in, uid);
+ h = (tree) htab_find_with_hash (gimple_referenced_vars (cfun), &in, uid);
gcc_assert (h || uid == 0);
- if (h)
- return h->to;
- return NULL_TREE;
+ return h;
}
/* Check if TO is in the referenced_vars hash table and insert it if not.
@@ -651,29 +649,23 @@ referenced_var_lookup (unsigned int uid)
bool
referenced_var_check_and_insert (tree to)
{
- struct int_tree_map *h, in;
- void **loc;
+ tree h, *loc;
+ struct tree_decl_minimal in;
unsigned int uid = DECL_UID (to);
in.uid = uid;
- in.to = to;
- h = (struct int_tree_map *) htab_find_with_hash (gimple_referenced_vars (cfun),
- &in, uid);
-
+ h = (tree) htab_find_with_hash (gimple_referenced_vars (cfun), &in, uid);
if (h)
{
/* DECL_UID has already been entered in the table. Verify that it is
the same entry as TO. See PR 27793. */
- gcc_assert (h->to == to);
+ gcc_assert (h == to);
return false;
}
- h = GGC_NEW (struct int_tree_map);
- h->uid = uid;
- h->to = to;
- loc = htab_find_slot_with_hash (gimple_referenced_vars (cfun),
- h, uid, INSERT);
- *(struct int_tree_map **) loc = h;
+ loc = (tree *) htab_find_slot_with_hash (gimple_referenced_vars (cfun),
+ &in, uid, INSERT);
+ *loc = to;
return true;
}
@@ -774,7 +766,7 @@ void
remove_referenced_var (tree var)
{
var_ann_t v_ann;
- struct int_tree_map in;
+ struct tree_decl_minimal in;
void **loc;
unsigned int uid = DECL_UID (var);
@@ -784,10 +776,8 @@ remove_referenced_var (tree var)
var->base.ann = NULL;
gcc_assert (DECL_P (var));
in.uid = uid;
- in.to = var;
loc = htab_find_slot_with_hash (gimple_referenced_vars (cfun), &in, uid,
NO_INSERT);
- ggc_free (*loc);
htab_clear_slot (gimple_referenced_vars (cfun), loc);
}