aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-flow-inline.h
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2005-11-04 18:02:51 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2005-11-04 18:02:51 +0000
commit8d66aecaffd36ef82905a4b225ac5e0932231c9d (patch)
treeb6f3557754fc7b55112b9e93cb62f67171fbea3b /gcc/tree-flow-inline.h
parent086ed39d00cae8912691bfd0cecb61011a34f835 (diff)
downloadgcc-8d66aecaffd36ef82905a4b225ac5e0932231c9d.zip
gcc-8d66aecaffd36ef82905a4b225ac5e0932231c9d.tar.gz
gcc-8d66aecaffd36ef82905a4b225ac5e0932231c9d.tar.bz2
tree-flow.h (ref_contains_indirect_ref): Rename to array_ref_contains_indirect_ref.
2005-11-04 Richard Guenther <rguenther@suse.de> * tree-flow.h (ref_contains_indirect_ref): Rename to array_ref_contains_indirect_ref. * tree-flow-inline.h (ref_contains_indirect_ref): Likewise. (array_ref_contains_indirect_ref): Make comment match the code and vice-versa. (ref_contains_array_ref): Likewise. * tree-ssa-structalias.c (find_func_aliases): Remove call to ref_contains_indirect_ref. * tree-ssa-loop-niter.c (infer_loop_bounds_from_undefined): Rename calls to ref_contains_indirect_ref. From-SVN: r106499
Diffstat (limited to 'gcc/tree-flow-inline.h')
-rw-r--r--gcc/tree-flow-inline.h36
1 files changed, 19 insertions, 17 deletions
diff --git a/gcc/tree-flow-inline.h b/gcc/tree-flow-inline.h
index d8b57a5..e31db44 100644
--- a/gcc/tree-flow-inline.h
+++ b/gcc/tree-flow-inline.h
@@ -1407,32 +1407,34 @@ unmodifiable_var_p (tree var)
return TREE_READONLY (var) && (TREE_STATIC (var) || DECL_EXTERNAL (var));
}
-/* Return true if REF, an ARRAY_REF, has an INDIRECT_REF somewhere in
- it. */
+/* Return true if REF, an ARRAY_REF, has an INDIRECT_REF somewhere in it. */
static inline bool
-ref_contains_indirect_ref (tree ref)
+array_ref_contains_indirect_ref (tree ref)
{
- while (handled_component_p (ref))
- {
- if (TREE_CODE (ref) == INDIRECT_REF)
- return true;
- ref = TREE_OPERAND (ref, 0);
- }
- return false;
+ gcc_assert (TREE_CODE (ref) == ARRAY_REF);
+
+ do {
+ ref = TREE_OPERAND (ref, 0);
+ } while (handled_component_p (ref));
+
+ return TREE_CODE (ref) == INDIRECT_REF;
}
-/* Return true if REF, a COMPONENT_REF, has an ARRAY_REF somewhere in it. */
+/* Return true if REF, a handled component reference, has an ARRAY_REF
+ somewhere in it. */
static inline bool
ref_contains_array_ref (tree ref)
{
- while (handled_component_p (ref))
- {
- if (TREE_CODE (ref) == ARRAY_REF)
- return true;
- ref = TREE_OPERAND (ref, 0);
- }
+ gcc_assert (handled_component_p (ref));
+
+ do {
+ if (TREE_CODE (ref) == ARRAY_REF)
+ return true;
+ ref = TREE_OPERAND (ref, 0);
+ } while (handled_component_p (ref));
+
return false;
}