diff options
author | Matt Austern <austern@apple.com> | 2003-02-19 05:39:06 +0000 |
---|---|---|
committer | Matt Austern <austern@gcc.gnu.org> | 2003-02-19 05:39:06 +0000 |
commit | 2f51bb1d5a7f4b358ac0c469b95779aeaeb03304 (patch) | |
tree | 7e08f1322b9d5b1d9d1838dc1d6c7f36cc47d1bc /gcc/langhooks.c | |
parent | ff6e1a2f26fb152187508cc3102bc10fb7b71b23 (diff) | |
download | gcc-2f51bb1d5a7f4b358ac0c469b95779aeaeb03304.zip gcc-2f51bb1d5a7f4b358ac0c469b95779aeaeb03304.tar.gz gcc-2f51bb1d5a7f4b358ac0c469b95779aeaeb03304.tar.bz2 |
toplev.c, [...]: Move write_global_declarations from toplev.c to langhooks.c.
* toplev.c, langhooks.c, langhooks-def.h: Move
write_global_declarations from toplev.c to langhooks.c.
From-SVN: r63094
Diffstat (limited to 'gcc/langhooks.c')
-rw-r--r-- | gcc/langhooks.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/langhooks.c b/gcc/langhooks.c index 912d5db..045a5e4 100644 --- a/gcc/langhooks.c +++ b/gcc/langhooks.c @@ -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); +} |