summaryrefslogtreecommitdiff
path: root/gcc/tree-flow-inline.h
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-02-25 21:20:34 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-02-25 21:20:34 +0000
commit3a0e28bda34bfc65320f301a503a41fcd0fb9cb1 (patch)
tree8266407752dab136d0fc9a405ebbc3aca2e08f48 /gcc/tree-flow-inline.h
parente4107e95e5f29b4e2f74f0b56b9971e7b3585337 (diff)
downloadgcc-3a0e28bda34bfc65320f301a503a41fcd0fb9cb1.tar.gz
2008-02-25 Richard Guenther <rguenther@suse.de>
Revert: 2008-02-25 Richard Guenther <rguenther@suse.de> * tree-flow.h (uid_decl_map_hash, uid_decl_map_eq): Move ... * tree.h (uid_decl_map_hash, uid_decl_map_eq): ... here. (lookup_decl_from_uid): Declare. * tree-ssa.c (uid_decl_map_eq, uid_decl_map_hash): Move ... * tree.c (uid_decl_map_eq, uid_decl_map_hash): ... here. (decl_for_uid_map): New global hashtable mapping DECL_UID to the decl tree. (init_ttree): Allocate it. (insert_decl_to_uid_decl_map): New helper function. (make_node_stat): Insert new decls into the map. (copy_node_stat): Likewise. (lookup_decl_from_uid): New function. (print_decl_for_uid_map_statistics): New helper. (dump_tree_statistics): Call it. * tree-flow.h (struct gimple_df): Make referenced_vars a bitmap. (referenced_var_iterator): Adjust. (FOR_EACH_REFERENCED_VAR): Adjust. (FOR_EACH_REFERENCED_VAR_IN_BITMAP): New iterator. (num_referenced_vars): Adjust. * tree-flow-inline.h (gimple_referenced_vars): Adjust. (first_referenced_var): Remove. (end_referenced_vars_p): Likewise. (next_referenced_var): Likewise. (referenced_var_iterator_set): New helper function. * tree-dfa.c (referenced_var_lookup): Adjust. (referenced_var_check_and_insert): Likewise. (remove_referenced_var): Likewise. * tree-ssa.c (verify_flow_insensitive_alias_info): Use FOR_EACH_REFERENCED_VAR_IN_BITMAP. (verify_call_clobbering): Likewise. (verify_memory_partitions): Likewise. (init_tree_ssa): Allocate bitmap instead of hashtable for referenced_vars. (delete_tree_ssa): Adjust. * tree-ssa-alias.c (mark_aliases_call_clobbered): Use FOR_EACH_REFERENCED_VAR_IN_BITMAP. (compute_tag_properties): Likewise. (set_initial_properties): Likewise. (find_partition_for): Likewise. (update_reference_counts): Likewise. (dump_may_aliases_for): Likewise. * tree-ssa-operands.c (add_virtual_operand): Likewise. (add_call_clobber_ops): Likewise. (add_call_read_ops): Likewise. (get_asm_expr_operands): Likewise. * tree-into-ssa.c (dump_decl_set): Likewise. (update_ssa): Likewise. * tree-sra.c (scan_function): Likewise. (decide_instantiations): Likewise. (scalarize_parms): Likewise. * tree-ssa-alias-warnings.c (build_reference_table): Likewise. (dsa_named_for): Likewise. * tree-ssa-structalias.c (update_alias_info): Likewise. (merge_smts_into): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132643 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-flow-inline.h')
-rw-r--r--gcc/tree-flow-inline.h37
1 files changed, 24 insertions, 13 deletions
diff --git a/gcc/tree-flow-inline.h b/gcc/tree-flow-inline.h
index 8fcb77fd1ab..1afbd1a8fc7 100644
--- a/gcc/tree-flow-inline.h
+++ b/gcc/tree-flow-inline.h
@@ -66,7 +66,7 @@ gimple_call_clobbered_vars (const struct function *fun)
}
/* Array of all variables referenced in the function. */
-static inline bitmap
+static inline htab_t
gimple_referenced_vars (const struct function *fun)
{
if (!fun->gimple_df)
@@ -145,23 +145,34 @@ next_htab_element (htab_iterator *hti)
return NULL;
}
-/* Helper for FOR_EACH_REFERENCED_VAR. Needed unless iterator
- bodies deal with NULL elements. */
+/* Initialize ITER to point to the first referenced variable in the
+ referenced_vars hashtable, and return that variable. */
+
+static inline tree
+first_referenced_var (referenced_var_iterator *iter)
+{
+ return (tree) first_htab_element (&iter->hti,
+ gimple_referenced_vars (cfun));
+}
+
+/* Return true if we have hit the end of the referenced variables ITER is
+ iterating through. */
static inline bool
-referenced_var_iterator_set (referenced_var_iterator *ri, tree *var)
+end_referenced_vars_p (const referenced_var_iterator *iter)
{
- while (1)
- {
- if (!bmp_iter_set (&ri->bi, &ri->i))
- return false;
- *var = lookup_decl_from_uid (ri->i);
- if (*var)
- return true;
- bmp_iter_next (&ri->bi, &ri->i);
- }
+ return end_htab_p (&iter->hti);
}
+/* Make ITER point to the next referenced_var in the referenced_var hashtable,
+ and return that variable. */
+
+static inline tree
+next_referenced_var (referenced_var_iterator *iter)
+{
+ return (tree) next_htab_element (&iter->hti);
+}
+
/* Fill up VEC with the variables in the referenced vars hashtable. */
static inline void