+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
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
#undef NAME_TYPE
/* Initialize LTO-specific data structures. */
- vec_alloc (lto_global_var_decls, 256);
in_lto_p = true;
return true;
#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;
static void
materialize_cgraph (void)
{
- tree decl;
struct cgraph_node *node;
- unsigned i;
timevar_id_t lto_timer;
if (!quiet_flag)
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");
do_whole_program_analysis ();
else
{
- varpool_node *vnode;
-
timevar_start (TV_PHASE_OPT_GEN);
materialize_cgraph ();
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);
}
}
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);