aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-flow.h
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2008-02-25 21:20:34 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2008-02-25 21:20:34 +0000
commit381a258b1e19d638ff442130bf59a1a26fb2212e (patch)
tree8266407752dab136d0fc9a405ebbc3aca2e08f48 /gcc/tree-flow.h
parent8dd07840af477dc858b5a8117bf10679e7fbf819 (diff)
downloadgcc-381a258b1e19d638ff442130bf59a1a26fb2212e.zip
gcc-381a258b1e19d638ff442130bf59a1a26fb2212e.tar.gz
gcc-381a258b1e19d638ff442130bf59a1a26fb2212e.tar.bz2
revert: tree-flow.h (uid_decl_map_hash, [...]): Move ...
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. From-SVN: r132643
Diffstat (limited to 'gcc/tree-flow.h')
-rw-r--r--gcc/tree-flow.h32
1 files changed, 14 insertions, 18 deletions
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index 476f02e..286c60b 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -138,8 +138,8 @@ struct mem_ref_stats_d GTY(())
fields should have gimple_set accessor. */
struct gimple_df GTY(())
{
- /* Bitmap of all variables referenced in the function. */
- bitmap referenced_vars;
+ /* Array of all variables referenced in the function. */
+ htab_t GTY((param_is (union tree_node))) referenced_vars;
/* A list of all the noreturn calls passed to modify_stmt.
cleanup_control_flow uses it to detect cases where a mid-block
@@ -569,29 +569,25 @@ struct int_tree_map GTY(())
extern unsigned int int_tree_map_hash (const void *);
extern int int_tree_map_eq (const void *, const void *);
+extern unsigned int uid_decl_map_hash (const void *);
+extern int uid_decl_map_eq (const void *, const void *);
+
typedef struct
{
- bitmap_iterator bi;
- unsigned int i;
+ htab_iterator hti;
} referenced_var_iterator;
+
/* This macro loops over all the referenced vars, one at a time, putting the
- current var in VAR. Note: It is undefined whether referenced variables
- you add or remove during the iteration show up or not. */
+ current var in VAR. Note: You are not allowed to add referenced variables
+ to the hashtable while using this macro. Doing so may cause it to behave
+ erratically. */
#define FOR_EACH_REFERENCED_VAR(VAR, ITER) \
- for (bmp_iter_set_init (&(ITER).bi, gimple_referenced_vars (cfun), 0, &(ITER).i); \
- referenced_var_iterator_set (&(ITER), &(VAR)); \
- bmp_iter_next (&(ITER).bi, &(ITER).i))
-
-/* Iterate over all variables whose UID is set in the bitmap BM, putting the
- current var in VAR. Note: It is undefined whether variables you add or
- remove during the iteration show up or not. */
+ for ((VAR) = first_referenced_var (&(ITER)); \
+ !end_referenced_vars_p (&(ITER)); \
+ (VAR) = next_referenced_var (&(ITER)))
-#define FOR_EACH_REFERENCED_VAR_IN_BITMAP(BM, VAR, ITER) \
- for (bmp_iter_set_init (&(ITER).bi, (BM), 0, &(ITER).i); \
- referenced_var_iterator_set (&(ITER), &(VAR)); \
- bmp_iter_next (&(ITER).bi, &(ITER).i))
typedef struct
{
@@ -613,7 +609,7 @@ typedef struct
extern tree referenced_var_lookup (unsigned int);
extern bool referenced_var_check_and_insert (tree);
-#define num_referenced_vars bitmap_count_bits (gimple_referenced_vars (cfun))
+#define num_referenced_vars htab_elements (gimple_referenced_vars (cfun))
#define referenced_var(i) referenced_var_lookup (i)
#define num_ssa_names (VEC_length (tree, cfun->gimple_df->ssa_names))