[llvm-commits] [llvm-gcc-4.2] r44420 - /llvm-gcc-4.2/trunk/gcc/tree.c
Chris Lattner
sabre at nondot.org
Wed Nov 28 14:45:08 PST 2007
Author: lattner
Date: Wed Nov 28 16:45:08 2007
New Revision: 44420
URL: http://llvm.org/viewvc/llvm-project?rev=44420&view=rev
Log:
Fix test/CFrontend/2007-11-28-GlobalInitializer.c for PR1744
Modified:
llvm-gcc-4.2/trunk/gcc/tree.c
Modified: llvm-gcc-4.2/trunk/gcc/tree.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree.c?rev=44420&r1=44419&r2=44420&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/tree.c (original)
+++ llvm-gcc-4.2/trunk/gcc/tree.c Wed Nov 28 16:45:08 2007
@@ -2887,6 +2887,22 @@
}
else if (CONSTANT_CLASS_P (node))
;
+/* APPLE LOCAL begin LLVM */
+#ifdef ENABLE_LLVM
+ /* Support the "array ref with pointer base" extension. If we have &p[i],
+ treat this like we do a binop.
+ */
+ else if (TREE_CODE(node) == ARRAY_REF &&
+ POINTER_TYPE_P(TREE_TYPE(TREE_OPERAND(node, 0)))) {
+ ti &= TREE_INVARIANT(TREE_OPERAND(node, 0)) &
+ TREE_INVARIANT(TREE_OPERAND(node, 1));
+ tc &= TREE_CONSTANT(TREE_OPERAND(node, 0)) &
+ TREE_CONSTANT(TREE_OPERAND(node, 1));
+ se |= TREE_SIDE_EFFECTS(TREE_OPERAND(node, 0)) |
+ TREE_SIDE_EFFECTS(TREE_OPERAND(node, 1));
+ }
+#endif
+/* APPLE LOCAL end LLVM */
else
{
ti = tc = false;
More information about the llvm-commits
mailing list