This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, committed] Add contains_view_convert_expr_p to tree-flow-inline.h
- From: Martin Jambor <mjambor at suse dot cz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 20 May 2009 12:30:06 +0200
- Subject: [PATCH, committed] Add contains_view_convert_expr_p to tree-flow-inline.h
Hi,
the following patch is required by the new SRA and was approved on IRC
by Richi. I have bootstrapped and tested it on x86_64-linux tonight
and committed with the other preparatory patches as revision 147733.
Thanks,
Martin
2009-05-20 Martin Jambor <mjambor@suse.cz>
* tree-flow-inline.h (contains_view_convert_expr_p): New function.
Index: mine/gcc/tree-flow-inline.h
===================================================================
--- mine.orig/gcc/tree-flow-inline.h 2009-05-08 21:12:34.000000000 +0200
+++ mine/gcc/tree-flow-inline.h 2009-05-08 22:35:11.000000000 +0200
@@ -1136,6 +1136,21 @@ ref_contains_array_ref (const_tree ref)
return false;
}
+/* Return true if REF has an VIEW_CONVERT_EXPR somewhere in it. */
+
+static inline bool
+contains_view_convert_expr_p (const_tree ref)
+{
+ while (handled_component_p (ref))
+ {
+ if (TREE_CODE (ref) == VIEW_CONVERT_EXPR)
+ return true;
+ ref = TREE_OPERAND (ref, 0);
+ }
+
+ return false;
+}
+
/* Return true, if the two ranges [POS1, SIZE1] and [POS2, SIZE2]
overlap. SIZE1 and/or SIZE2 can be (unsigned)-1 in which case the
range is open-ended. Otherwise return false. */