Commit f0f91770 by Richard Biener Committed by Richard Biener

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
parent 6fc59523
2014-02-05 Richard Biener <rguenther@suse.de>
* 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 <hubicka@ucw.cz>
* lto-partition.c (get_symbol_class): Only unforced DECL_ONE_ONLY
......
......@@ -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;
......
......@@ -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<tree, va_gc> *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);
}
}
......
......@@ -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<tree, va_gc> *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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment