This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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?

--Matt


Index: gcc/langhooks-def.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/langhooks-def.h,v
retrieving revision 1.39.2.1
diff -u -r1.39.2.1 langhooks-def.h
--- gcc/langhooks-def.h 18 Feb 2003 18:53:17 -0000 1.39.2.1
+++ 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, tree));

-/* In toplev.c */
void write_global_declarations PARAMS ((void));

#define LANG_HOOKS_NAME "GNU unknown"
Index: gcc/langhooks.c
===================================================================
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 @@
else
return size_in_bytes (TREE_TYPE (exp));
}
+
+/* lang_hooks.decls.final_write_globals: perform final processing on
+ global variables. */
+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);
+ }
+}
Index: gcc/toplev.c
===================================================================
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 @@
timevar_pop (TV_DUMP);
}
}
-
-/* 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]