lto.h (lto_global_var_decls): Remove.
authorRichard Biener <rguenther@suse.de>
Wed, 5 Feb 2014 15:23:36 +0000 (15:23 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 5 Feb 2014 15:23:36 +0000 (15:23 +0000)
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

gcc/lto/ChangeLog
gcc/lto/lto-lang.c
gcc/lto/lto.c
gcc/lto/lto.h

index 0f9e6882b5fb6a03f9829824c53414de5044be59..15610f277feb6ec5e3b5e937d2cbd6564bc36f80 100644 (file)
@@ -1,3 +1,14 @@
+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 
index b5e5d6a6b578abe1ddf2f1890237f2309fbc9b5c..0ef65cf5c86a6c035e9d094f44215619c11fb290 100644 (file)
@@ -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;
index a769f25a21488192568cbd997e4efaf287e8c8bb..579c91c5864fd811a20aa187721450b707178772 100644 (file)
@@ -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);
        }
     }
 
index bb8e2edfc5559f0d7ec4a87957465ca28399cfc0..3c3c3264c0cf90f83e01d8feefd2c8e3c9c0c649 100644 (file)
@@ -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);