diff options
Diffstat (limited to 'gcc/tree-flow.h')
-rw-r--r-- | gcc/tree-flow.h | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h index 42c6d72f216..4a11a4eb49d 100644 --- a/gcc/tree-flow.h +++ b/gcc/tree-flow.h @@ -41,6 +41,20 @@ typedef struct basic_block_def *basic_block; /* True if the code is in ssa form. */ extern bool in_ssa_p; +typedef struct +{ + htab_t htab; + PTR *slot; + PTR *limit; +} htab_iterator; + +/* Iterate through the elements of hashtable HTAB, using htab_iterator ITER, + storing each element in RESULT, which is of type TYPE. */ +#define FOR_EACH_HTAB_ELEMENT(HTAB, RESULT, TYPE, ITER) \ + for (RESULT = (TYPE) first_htab_element (&(ITER), (HTAB)); \ + !end_htab_p (&(ITER)); \ + RESULT = (TYPE) next_htab_element (&(ITER))) + /*--------------------------------------------------------------------------- Attributes for SSA_NAMEs. @@ -208,9 +222,6 @@ struct var_ann_d GTY(()) /* Variables that may alias this variable. */ varray_type may_aliases; - /* Unique ID of this variable. */ - size_t uid; - /* Used when going out of SSA form to indicate which partition this variable represents storage for. */ unsigned partition; @@ -356,11 +367,33 @@ static inline void set_phi_nodes (basic_block, tree); /*--------------------------------------------------------------------------- Global declarations ---------------------------------------------------------------------------*/ +struct int_tree_map GTY(()) +{ + + unsigned int uid; + tree to; +}; + +extern unsigned int int_tree_map_hash (const void *); +extern int int_tree_map_eq (const void *, const void *); + +typedef struct +{ + htab_iterator hti; +} referenced_var_iterator; + + +#define FOR_EACH_REFERENCED_VAR(VAR, ITER) \ + for ((VAR) = first_referenced_var (&(ITER)); \ + !end_referenced_vars_p (&(ITER)); \ + (VAR) = next_referenced_var (&(ITER))) + /* Array of all variables referenced in the function. */ -extern GTY(()) VEC(tree,gc) *referenced_vars; +extern GTY((param_is (struct int_tree_map))) htab_t referenced_vars; -#define num_referenced_vars VEC_length (tree, referenced_vars) -#define referenced_var(i) VEC_index (tree, referenced_vars, i) +extern tree referenced_var_lookup (unsigned int); +#define num_referenced_vars htab_elements (referenced_vars) +#define referenced_var(i) referenced_var_lookup (i) /* Array of all SSA_NAMEs used in the function. */ extern GTY(()) VEC(tree,gc) *ssa_names; |