toplev.c, [...]: Move write_global_declarations from toplev.c to langhooks.c.
authorMatt Austern <austern@apple.com>
Wed, 19 Feb 2003 05:39:06 +0000 (05:39 +0000)
committerMatt Austern <austern@gcc.gnu.org>
Wed, 19 Feb 2003 05:39:06 +0000 (05:39 +0000)
* toplev.c, langhooks.c, langhooks-def.h: Move
write_global_declarations from toplev.c to langhooks.c.

From-SVN: r63094

gcc/ChangeLog
gcc/langhooks-def.h
gcc/langhooks.c
gcc/toplev.c

index ae5510e82a6c6b9c4b7fc2a37a8f7f661128f210..22d70924a92dd5a2465a4917b46a9e469e44c51d 100644 (file)
@@ -1,3 +1,7 @@
+2003-02-18  Matt Austern <austern@apple.com>
+       * toplev.c, langhooks.c, langhooks-def.h: Move
+       write_global_declarations from toplev.c to langhooks.c. 
+       
 2003-02-18  Kazu Hirata  <kazu@cs.umass.edu>
 
        * config/h8300/h8300.c (general_operand_src): Always check
index 6fc10603a7f8b3d1f7435cafd05bf9f9ec09b2a7..8834e787457dcb614ea9dd94a9b706d95b848ead 100644 (file)
@@ -82,7 +82,6 @@ int lhd_tree_inlining_start_inlining          PARAMS ((tree));
 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 912d5db7455b4cdfa3b49e68b873b015c7dc50a9..045a5e4bebd03ef7b2188a0455f80133dbaeacd3 100644 (file)
@@ -448,3 +448,32 @@ lhd_expr_size (exp)
   else
     return size_in_bytes (TREE_TYPE (exp));
 }
+
+/* lang_hooks.decls.final_write_globals: perform final processing on
+   global variables. */
+void
+write_global_declarations ()
+{
+  /* 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.  */
+
+  tree globals = (*lang_hooks.decls.getdecls) ();
+  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 c72f54f3584007ed98baa217f1c86afeb92307b8..9322f4fecf35d94e24d3356eef1ee520b8b6a0d8 100644 (file)
@@ -72,7 +72,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "debug.h"
 #include "target.h"
 #include "langhooks.h"
-#include "langhooks-def.h"
 #include "cfglayout.h"
 #include "cfgloop.h"
 #include "hosthooks.h"
@@ -2225,36 +2224,6 @@ compile_file ()
       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);
-  }
-}
 \f
 /* This is called from various places for FUNCTION_DECL, VAR_DECL,
    and TYPE_DECL nodes.