From: Richard Biener Date: Wed, 5 Feb 2014 15:23:36 +0000 (+0000) Subject: lto.h (lto_global_var_decls): Remove. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f0f91770c34553275669df72794f5d478ae5fe7c;p=gcc.git lto.h (lto_global_var_decls): Remove. 2014-02-05 Richard Biener 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 --- diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 0f9e6882b5f..15610f277fe 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,14 @@ +2014-02-05 Richard Biener + + * 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. + 2014-02-04 Jan Hubicka * lto-partition.c (get_symbol_class): Only unforced DECL_ONE_ONLY diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c index b5e5d6a6b57..0ef65cf5c86 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 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; diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index a769f25a214..579c91c5864 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -50,8 +50,6 @@ along with GCC; see the file COPYING3. If not see #include "context.h" #include "pass_manager.h" -/* Vector to keep track of external variables we've seen so far. */ -vec *lto_global_var_decls; static GTY(()) tree first_personality_decl; @@ -3009,9 +3007,7 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames) static void materialize_cgraph (void) { - tree decl; struct cgraph_node *node; - unsigned i; timevar_id_t lto_timer; if (!quiet_flag) @@ -3043,10 +3039,6 @@ materialize_cgraph (void) current_function_decl = NULL; set_cfun (NULL); - /* Inform the middle end about the global variables we have seen. */ - FOR_EACH_VEC_ELT (*lto_global_var_decls, i, decl) - rest_of_decl_compilation (decl, 1, 0); - if (!quiet_flag) fprintf (stderr, "\n"); @@ -3309,8 +3301,6 @@ lto_main (void) do_whole_program_analysis (); else { - varpool_node *vnode; - timevar_start (TV_PHASE_OPT_GEN); materialize_cgraph (); @@ -3330,10 +3320,6 @@ lto_main (void) this. */ if (flag_lto_report || (flag_wpa && flag_lto_report_wpa)) print_lto_report_1 (); - - /* Record the global variables. */ - FOR_EACH_DEFINED_VARIABLE (vnode) - vec_safe_push (lto_global_var_decls, vnode->decl); } } diff --git a/gcc/lto/lto.h b/gcc/lto/lto.h index bb8e2edfc55..3c3c3264c0c 100644 --- a/gcc/lto/lto.h +++ b/gcc/lto/lto.h @@ -41,9 +41,6 @@ extern tree lto_eh_personality (void); extern void lto_main (void); extern void lto_read_all_file_options (void); -/* In lto-symtab.c */ -extern GTY(()) vec *lto_global_var_decls; - /* In lto-elf.c or lto-coff.c */ extern lto_file *lto_obj_file_open (const char *filename, bool writable); extern void lto_obj_file_close (lto_file *file);