summaryrefslogtreecommitdiff
path: root/gcc/tree-flow-inline.h
diff options
context:
space:
mode:
authordberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-30 22:18:42 +0000
committerdberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-30 22:18:42 +0000
commita55dc2cd86f718c1ad76ce7d418c9a8a44b2440b (patch)
tree93a9e5ca3a3ce97f70134506548b6bda75edd769 /gcc/tree-flow-inline.h
parenteb8c35b0e5b145fd1af8ec1337194ecc967ad753 (diff)
downloadgcc-a55dc2cd86f718c1ad76ce7d418c9a8a44b2440b.tar.gz
2005-06-29 Daniel Berlin <dberlin@dberlin.org>
* tree-complex.c (complex_variable_components): Now a hashtable. (cvc_lookup): Ditto. (cvc_insert): Ditto. (create_components): Use referenced var iterator. Initialize hashtable. Use cvc_insert/lookup. (extract_components): Use cvc_insert/lookup. (update_complex_components): Ditto. (update_complex_components_on_edge): Ditto. * tree-dfa.c (referenced_vars): Now a hashtable. (dump_referenced_vars): Use iterator. (referenced_var_lookup): New function. (referenced_var_insert): Ditto. (add_referenced_var): Use referenced_var_insert. (mark_new_vars_to_rename): Use DECL_UID. * tree-flow-inline.h (first_htab_element): New function. (end_htab_p): Ditto. (next_htab_element): Ditto. (first_referenced_var): Ditto. (end_referenced_vars_p): Ditto. (next_referenced_var): Ditto. (is_call_clobbered): Use DECL_UID. (mark_call_clobbered): Ditto. (clear_call_clobbered): Ditto. (mark_non_addressable): Ditto. * tree-flow.h (htab_iterator): New struct. (FOR_EACH_HTAB_ELEMENT): New macro. (struct int_tree_map): New struct. (int_tree_map_hash): Prototype. (int_tree_map_eq): Ditto. (referenced_var_iterator): Ditto. (FOR_EACH_REFERENCED_VAR): New macro. (referenced_vars): Now a hashtable. * tree-into-ssa.c (symbol_marked_for_renaming): Use DECL_UID. (add_new_name_mapping): Ditto. (mark_def_sites): Ditto. (insert_phi_nodes): Use referenced_var iterator. (mark_def_site_blocks): Ditto. (mark_sym_for_renaming): Use DECL_UID. * tree-sra.c (is_sra_candidate_decl): Use DECL_UID. (lookup_element): Ditto. (find_candidates_for_sra): Use referenced_vars iterator. Use DECL_UID. * tree-ssa-alias.c (NUM_REFERENCES): New macro. (NUM_REFERENCES_CLEAR): Ditto. (NUM_REFERENCES_INC): Ditto. (NUM_REFERENCES_SET): Ditto. (alias_obstack): New bitmap obstack. (struct alias_map_d): Use bitmap, not sbitmap. (struct alias_info): Remove num_references. (init_alias_info): Use referenced_var iterator. Initialize bitmap obstack. (delete_alias_info): Use referenced_var iterator. Free bitmap obstack. (compute_points_to_and_addr_escape): Use DECL_UID. Use new NUM_REFERENCES macros. (compute_flow_sensitive_aliasing): may_aliases is now a bitmap. Use new NUM_REFERENCES macros. (group_aliases_into): Update prototype to use bitmap. (setup_pointers_and_addressables): Use referenced_vars iterator. Use DECL_UID. Use new NUM_REFERENCES macros. (add_pointed_to_var): Use DECL_UID. (dump_alias_info): Use referenced_var iterator. (add_type_alias): Ditto. (used_portions): Now a hashtable. (used_part_map_eq): New function. (used_part_map_hash): Ditto. (free_used_part_map): Ditto. (up_lookup): Ditto. (up_insert): Ditto. (get_or_create_used_part_for): Use up_lookup. (create_overlap_variables_for): Ditto. (find_used_portions): Use up_insert. Use DECL_UID. (create_structure_vars): Init used_portions hashtable, use referenced_vars iterator. * tree-ssa-live.c (create_ssa_var_map): sbitmaps became bitmaps. Use DECL_UID. * tree-ssa-loop-im.c (gather_mem_refs_stmt): Use DECL_UID. * tree-ssa-operands.c (get_asm_expr_operands): Ditto. (note_addressable): Ditto. * tree-ssa-structalias.c (set_uids_in_ptset): Ditto. * tree-ssa.c (verify_flow_insensitive_alias_info): Use referenced_var iterator. Use DECL_UID. (delete_tree_ssa): Ditto. (int_tree_map_eq): New function. (int_tree_map_hash): Ditto. * tree-stdarg.c (find_va_list_reference): Use DECL_UID. (va_list_ptr_read): Ditto. (va_list_counter_struct_op): Ditto. (va_list_ptr_write): Ditto. (check_va_list_escapes): Ditto. (check_all_va_list_escapes): Ditto. (execute_optimize_stdarg): Ditto. * tree-tailcall.c (suitable_for_tail_opt_p): Used referenced_var iterator. 2005-06-30 Daniel Berlin <dberlin@dberlin.org> * hashtab.h (HTAB_DELETED_ENTRY): New macro. (HTAB_EMPTY_ENTRY): New macro. 2005-06-30 Daniel Berlin <dberlin@dberlin.org> * hashtab.c (EMPTY_ENTRY): Moved and renamed. (DELETED_ENTRY): Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101480 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-flow-inline.h')
-rw-r--r--gcc/tree-flow-inline.h89
1 files changed, 85 insertions, 4 deletions
diff --git a/gcc/tree-flow-inline.h b/gcc/tree-flow-inline.h
index e2ed2f30d2a..13f94ac582d 100644
--- a/gcc/tree-flow-inline.h
+++ b/gcc/tree-flow-inline.h
@@ -25,6 +25,87 @@ Boston, MA 02110-1301, USA. */
/* Inline functions for manipulating various data structures defined in
tree-flow.h. See tree-flow.h for documentation. */
+/* Initialize the hashtable iterator HTI to point to hashtable TABLE */
+
+static inline void *
+first_htab_element (htab_iterator *hti, htab_t table)
+{
+ hti->htab = table;
+ hti->slot = table->entries;
+ hti->limit = hti->slot + htab_size (table);
+ do
+ {
+ PTR x = *(hti->slot);
+ if (x != HTAB_EMPTY_ENTRY && x != HTAB_DELETED_ENTRY)
+ break;
+ } while (++(hti->slot) < hti->limit);
+
+ if (hti->slot < hti->limit)
+ return *(hti->slot);
+ return NULL;
+}
+
+/* Return current non-empty/deleted slot of the hashtable pointed to by HTI,
+ or NULL if we have reached the end. */
+
+static inline bool
+end_htab_p (htab_iterator *hti)
+{
+ if (hti->slot >= hti->limit)
+ return true;
+ return false;
+}
+
+/* Advance the hashtable iterator pointed by HTI to the next element of the
+ hashtable. */
+
+static inline void *
+next_htab_element (htab_iterator *hti)
+{
+ while (++(hti->slot) < hti->limit)
+ {
+ PTR x = *(hti->slot);
+ if (x != HTAB_EMPTY_ENTRY && x != HTAB_DELETED_ENTRY)
+ return x;
+ };
+ return NULL;
+}
+
+/* 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)
+{
+ struct int_tree_map *itm;
+ itm = first_htab_element (&iter->hti, referenced_vars);
+ if (!itm)
+ return NULL;
+ return itm->to;
+}
+
+/* Return true if we have hit the end of the referenced variables ITER is
+ iterating through. */
+
+static inline bool
+end_referenced_vars_p (referenced_var_iterator *iter)
+{
+ 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)
+{
+ struct int_tree_map *itm;
+ itm = next_htab_element (&iter->hti);
+ if (!itm)
+ return NULL;
+ return itm->to;
+}
+
/* Return the variable annotation for T, which must be a _DECL node.
Return NULL if the variable annotation doesn't already exist. */
static inline var_ann_t
@@ -752,7 +833,7 @@ static inline bool
is_call_clobbered (tree var)
{
return is_global_var (var)
- || bitmap_bit_p (call_clobbered_vars, var_ann (var)->uid);
+ || bitmap_bit_p (call_clobbered_vars, DECL_UID (var));
}
/* Mark variable VAR as being clobbered by function calls. */
@@ -766,7 +847,7 @@ mark_call_clobbered (tree var)
location in global memory. */
if (ann->mem_tag_kind != NOT_A_TAG && ann->mem_tag_kind != STRUCT_FIELD)
DECL_EXTERNAL (var) = 1;
- bitmap_set_bit (call_clobbered_vars, ann->uid);
+ bitmap_set_bit (call_clobbered_vars, DECL_UID (var));
ssa_call_clobbered_cache_valid = false;
ssa_ro_call_cache_valid = false;
}
@@ -778,7 +859,7 @@ clear_call_clobbered (tree var)
var_ann_t ann = var_ann (var);
if (ann->mem_tag_kind != NOT_A_TAG && ann->mem_tag_kind != STRUCT_FIELD)
DECL_EXTERNAL (var) = 0;
- bitmap_clear_bit (call_clobbered_vars, ann->uid);
+ bitmap_clear_bit (call_clobbered_vars, DECL_UID (var));
ssa_call_clobbered_cache_valid = false;
ssa_ro_call_cache_valid = false;
}
@@ -787,7 +868,7 @@ clear_call_clobbered (tree var)
static inline void
mark_non_addressable (tree var)
{
- bitmap_clear_bit (call_clobbered_vars, var_ann (var)->uid);
+ bitmap_clear_bit (call_clobbered_vars, DECL_UID (var));
TREE_ADDRESSABLE (var) = 0;
ssa_call_clobbered_cache_valid = false;
ssa_ro_call_cache_valid = false;