This is the mail archive of the
mailing list for the GCC project.
PATCH: fix bootstrap failure from my earlier patch
- From: Matt Austern <austern at apple dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 18 Feb 2003 17:05:16 -0800
- Subject: PATCH: fix bootstrap failure from my earlier patch
Sorry about the goof. This time it really does bootstrap on linux,
with mainline and with 3.3 release branch?
This patch does the obvious thing: it moves write_global_declarations
from toplev.c to langhooks.c. I resisted that at first, since I wanted
to keep logically related functions together, but (a) it's the easiest
fix; and (b) I do have to admit that it's odd to have just that one
langhook sitting in a different file than all the others.
OK to commit to 3.3 and mainline?
RCS file: /cvs/gcc/gcc/gcc/langhooks-def.h,v
retrieving revision 22.214.171.124
diff -u -r126.96.36.199 langhooks-def.h
--- gcc/langhooks-def.h 18 Feb 2003 18:53:17 -0000 188.8.131.52
+++ gcc/langhooks-def.h 19 Feb 2003 01:00:53 -0000
@@ -82,7 +82,6 @@
void lhd_tree_inlining_end_inlining PARAMS ((tree));
tree lhd_tree_inlining_convert_parm_for_inlining PARAMS ((tree, tree,
-/* In toplev.c */
void write_global_declarations PARAMS ((void));
#define LANG_HOOKS_NAME "GNU unknown"
RCS file: /cvs/gcc/gcc/gcc/langhooks.c,v
retrieving revision 1.34
diff -u -r1.34 langhooks.c
--- gcc/langhooks.c 22 Sep 2002 14:09:34 -0000 1.34
+++ gcc/langhooks.c 19 Feb 2003 01:00:53 -0000
@@ -442,3 +442,35 @@
return size_in_bytes (TREE_TYPE (exp));
+/* lang_hooks.decls.final_write_globals: perform final processing on
+ global variables. */
+ tree globals = (*lang_hooks.decls.getdecls) ();
+ /* Really define vars that have had only a tentative definition.
+ Really output inline functions that must actually be callable
+ and have not been output so far. */
+ int len = list_length (globals);
+ tree *vec = (tree *) xmalloc (sizeof (tree) * len);
+ int i;
+ tree decl;
+ /* Process the decls in reverse order--earliest first.
+ Put them into VEC from back to front, then take out from front.
+ for (i = 0, decl = globals; i < len; i++, decl = TREE_CHAIN (decl))
+ vec[len - i - 1] = decl;
+ wrapup_global_declarations (vec, len);
+ check_global_declarations (vec, len);
+ /* Clean up. */
+ free (vec);
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.690.2.1
diff -u -r1.690.2.1 toplev.c
--- gcc/toplev.c 18 Feb 2003 18:53:20 -0000 1.690.2.1
+++ gcc/toplev.c 19 Feb 2003 01:00:55 -0000
@@ -2200,36 +2200,6 @@
-/* Default for lang_hooks.decls.final_write_globals */
-void write_global_declarations ()
- tree globals = (*lang_hooks.decls.getdecls) ();
- /* Really define vars that have had only a tentative definition.
- Really output inline functions that must actually be callable
- and have not been output so far. */
- int len = list_length (globals);
- tree *vec = (tree *) xmalloc (sizeof (tree) * len);
- int i;
- tree decl;
- /* Process the decls in reverse order--earliest first.
- Put them into VEC from back to front, then take out from front.
- for (i = 0, decl = globals; i < len; i++, decl = TREE_CHAIN (decl))
- vec[len - i - 1] = decl;
- wrapup_global_declarations (vec, len);
- check_global_declarations (vec, len);
- /* Clean up. */
- free (vec);
/* This is called from various places for FUNCTION_DECL, VAR_DECL,
and TYPE_DECL nodes.