diff options
author | Richard Guenther <rguenther@suse.de> | 2008-02-28 09:56:54 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2008-02-28 09:56:54 +0000 |
commit | 3b3024215fae5daf1db2634fe070061837947458 (patch) | |
tree | 827872f3375cda4e3f251831d7fabfc631d7be29 /gcc/tree-flow.h | |
parent | f4abe9e0e3f36d33d40aed76f7b5a40d84f3e5f8 (diff) | |
download | gcc-3b3024215fae5daf1db2634fe070061837947458.zip gcc-3b3024215fae5daf1db2634fe070061837947458.tar.gz gcc-3b3024215fae5daf1db2634fe070061837947458.tar.bz2 |
revert: tree-flow.h (uid_decl_map_hash, [...]): Move ...
2008-02-28 Richard Guenther <rguenther@suse.de>
Revert:
2008-02-26 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.
(remove_decl_from_map): Likewise.
* 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.
(remove_decl_from_map): Likewise.
(print_decl_for_uid_map_statistics): New helper.
(dump_tree_statistics): Call it.
cp/
* decl.c (duplicate_decls): Remove decl from global mapping
before ggc_freeing 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: r132740
Diffstat (limited to 'gcc/tree-flow.h')
-rw-r--r-- | gcc/tree-flow.h | 32 |
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)) |