[llvm-commits] [llvm-gcc-4.2] r50501 - /llvm-gcc-4.2/branches/Apple/Tak/gcc/objc/objc-act.c
Bill Wendling
isanbard at gmail.com
Wed Apr 30 15:15:04 PDT 2008
Author: void
Date: Wed Apr 30 17:15:04 2008
New Revision: 50501
URL: http://llvm.org/viewvc/llvm-project?rev=50501&view=rev
Log:
Porting r50487 to Tak.
Modified:
llvm-gcc-4.2/branches/Apple/Tak/gcc/objc/objc-act.c
Modified: llvm-gcc-4.2/branches/Apple/Tak/gcc/objc/objc-act.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Tak/gcc/objc/objc-act.c?rev=50501&r1=50500&r2=50501&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Tak/gcc/objc/objc-act.c (original)
+++ llvm-gcc-4.2/branches/Apple/Tak/gcc/objc/objc-act.c Wed Apr 30 17:15:04 2008
@@ -6520,24 +6520,16 @@
In both of this cases, expr is preserved as ARRAY_REF. Normally, gcc
would decomponse first example into a pointer arithmetic expression.
- So in llvm mode, check expression's field type to ensure that this is really a
- array reference or not. */
+ So in llvm mode, check expression's field type to ensure that this is really
+ an array reference or not. */
static int objc_is_really_array_ref(tree expr) {
- tree component = NULL_TREE;
- tree field = NULL_TREE;
+ tree base = NULL_TREE;
if (TREE_CODE(expr) != ARRAY_REF)
return 0;
- component = TREE_OPERAND(expr, 0);
- if (!component || TREE_CODE(component) != COMPONENT_REF)
- return 0;
-
- field = TREE_OPERAND(component, 1);
- if (!field || TREE_CODE(TREE_TYPE(field)) != ARRAY_TYPE)
- return 0;
-
- return 1;
+ base = TREE_OPERAND(expr, 0);
+ return base && TREE_CODE(TREE_TYPE(base)) == ARRAY_TYPE;
}
/* LLVM LOCAL - end pointer arithmetic */
More information about the llvm-commits
mailing list