diff options
author | Richard Biener <rguenther@suse.de> | 2014-02-05 15:23:36 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2014-02-05 15:23:36 +0000 |
commit | f0f91770c34553275669df72794f5d478ae5fe7c (patch) | |
tree | 4b1c031686beae28ef49b51378b37ee5fa2a379a /gcc/lto/lto-lang.c | |
parent | 6fc595232b90a0f31a02087a152e2741fb0dee8f (diff) | |
download | gcc-f0f91770c34553275669df72794f5d478ae5fe7c.zip gcc-f0f91770c34553275669df72794f5d478ae5fe7c.tar.gz gcc-f0f91770c34553275669df72794f5d478ae5fe7c.tar.bz2 |
lto.h (lto_global_var_decls): Remove.
2014-02-05 Richard Biener <rguenther@suse.de>
lto/
* lto.h (lto_global_var_decls): Remove.
* lto-lang.c (lto_init): Do not allocate lto_global_var_decls.
(lto_write_globals): Do nothing in WPA stage, gather globals from
the varpool here ...
* lto.c (lto_main): ... not here.
(materialize_cgraph): Do not call rest_of_decl_compilation
on the empty lto_global_var_decls vector.
(lto_global_var_decls): Remove.
From-SVN: r207510
Diffstat (limited to 'gcc/lto/lto-lang.c')
-rw-r--r-- | gcc/lto/lto-lang.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c index b5e5d6a..0ef65cf 100644 --- a/gcc/lto/lto-lang.c +++ b/gcc/lto/lto-lang.c @@ -1075,11 +1075,20 @@ lto_getdecls (void) static void lto_write_globals (void) { - tree *vec = lto_global_var_decls->address (); - int len = lto_global_var_decls->length (); + if (flag_wpa) + return; + + /* Record the global variables. */ + vec<tree> lto_global_var_decls = vNULL; + varpool_node *vnode; + FOR_EACH_DEFINED_VARIABLE (vnode) + lto_global_var_decls.safe_push (vnode->decl); + + tree *vec = lto_global_var_decls.address (); + int len = lto_global_var_decls.length (); wrapup_global_declarations (vec, len); emit_debug_global_declarations (vec, len); - vec_free (lto_global_var_decls); + lto_global_var_decls.release (); } static tree @@ -1218,7 +1227,6 @@ lto_init (void) #undef NAME_TYPE /* Initialize LTO-specific data structures. */ - vec_alloc (lto_global_var_decls, 256); in_lto_p = true; return true; |