[llvm-commits] [127290] Fix a bug handling nested functions, due to LLVM' s handled_component_p working
clattner at apple.com
clattner at apple.com
Tue May 15 13:30:21 PDT 2007
Revision: 127290
Author: clattner
Date: 2007-05-15 13:30:21 -0700 (Tue, 15 May 2007)
Log Message:
-----------
Fix a bug handling nested functions, due to LLVM's handled_component_p working
a bit differently. This fixes an infinite recursion on
test/CFrontend/nested-functions.c
Modified Paths:
--------------
apple-local/branches/llvm/gcc/tree-nested.c
Modified: apple-local/branches/llvm/gcc/tree-nested.c
===================================================================
--- apple-local/branches/llvm/gcc/tree-nested.c 2007-05-15 17:00:03 UTC (rev 127289)
+++ apple-local/branches/llvm/gcc/tree-nested.c 2007-05-15 20:30:21 UTC (rev 127290)
@@ -882,7 +882,15 @@
of whether a NOP_EXPR or VIEW_CONVERT_EXPR needs a simple value. */
wi->val_only = true;
wi->is_lhs = false;
+ /* APPLE LOCAL begin LLVM */
+#ifdef ENABLE_LLVM
+ /* Support the "array ref with pointer base" extension. */
+ for (; handled_component_p (t) || TREE_CODE(t) == ARRAY_REF;
+ tp = &TREE_OPERAND (t, 0), t = *tp)
+#else
for (; handled_component_p (t); tp = &TREE_OPERAND (t, 0), t = *tp)
+#endif
+ /* APPLE LOCAL end LLVM */
{
if (TREE_CODE (t) == COMPONENT_REF)
walk_tree (&TREE_OPERAND (t, 2), convert_nonlocal_reference, wi,
@@ -1017,7 +1025,16 @@
save_val_only = wi->val_only;
wi->val_only = true;
wi->is_lhs = false;
+
+ /* APPLE LOCAL begin LLVM */
+#ifdef ENABLE_LLVM
+ /* Support the "array ref with pointer base" extension. */
+ for (; handled_component_p (t) || TREE_CODE(t) == ARRAY_REF;
+ tp = &TREE_OPERAND (t, 0), t = *tp)
+#else
for (; handled_component_p (t); tp = &TREE_OPERAND (t, 0), t = *tp)
+#endif
+ /* APPLE LOCAL end LLVM */
{
if (TREE_CODE (t) == COMPONENT_REF)
walk_tree (&TREE_OPERAND (t, 2), convert_local_reference, wi,
More information about the llvm-commits
mailing list