aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-flow-inline.h
diff options
context:
space:
mode:
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 8fcb77f..1afbd1a 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