[llvm-commits] [llvm-gcc-4.2] r63087 - /llvm-gcc-4.2/trunk/gcc/tree-nested.c
Dale Johannesen
dalej at apple.com
Mon Jan 26 18:02:36 PST 2009
Author: johannes
Date: Mon Jan 26 20:02:36 2009
New Revision: 63087
URL: http://llvm.org/viewvc/llvm-project?rev=63087&view=rev
Log:
Fix g++.apple/blocks-in_structors.c on Darwin.
This allows a null "root" in initialize_chains,
and removes a mysterious llvm assert in
convert_all_function_calls. Both situtations
seem to occur legitimately in this example, and
nothing in the testsuite breaks.
Modified:
llvm-gcc-4.2/trunk/gcc/tree-nested.c
Modified: llvm-gcc-4.2/trunk/gcc/tree-nested.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree-nested.c?rev=63087&r1=63086&r2=63087&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/tree-nested.c (original)
+++ llvm-gcc-4.2/trunk/gcc/tree-nested.c Mon Jan 26 20:02:36 2009
@@ -1732,7 +1732,7 @@
static void
initialize_chains (struct nesting_info *root) {
- do
+ while (root)
{
if (root->inner)
initialize_chains (root->inner);
@@ -1747,7 +1747,6 @@
root = root->next;
}
- while (root);
}
/* Helper for propagate_chains. Set the chain flag on a function and all of
@@ -1972,20 +1971,11 @@
walk_function (convert_tramp_reference, root);
walk_function (convert_call_expr, root);
- /* LLVM LOCAL begin */
- /* FIXME: Keep the LLVM-way? */
-#ifdef ENABLE_LLVM
- gcc_assert (!root->outer ||
- DECL_NO_STATIC_CHAIN (root->context) ==
- !(root->chain_decl || root->chain_field));
-#else
/* If the function does not use a static chain, then remember that. */
if (root->outer && !root->chain_decl && !root->chain_field)
DECL_NO_STATIC_CHAIN (root->context) = 1;
else
gcc_assert (!DECL_NO_STATIC_CHAIN (root->context));
-#endif
- /* LLVM LOCAL end */
root = root->next;
}
More information about the llvm-commits
mailing list