aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2010-09-09 02:09:07 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2010-09-09 00:09:07 +0000
commit098a4f50db43e6b8895f5ace49cbb1dc0be18c88 (patch)
treefa9bbf79f02320f36bb4373308277991e963b1fa
parentbc707992399b622a1ebcc2ca7ccac49da250fbc0 (diff)
downloadgcc-098a4f50db43e6b8895f5ace49cbb1dc0be18c88.zip
gcc-098a4f50db43e6b8895f5ace49cbb1dc0be18c88.tar.gz
gcc-098a4f50db43e6b8895f5ace49cbb1dc0be18c88.tar.bz2
lto.c (real_file_count, [...]): New static vars.
* lto.c (real_file_count, real_file_decl_data): New static vars. (read_cgraph_and_symbols): Use it. From-SVN: r164037
-rw-r--r--gcc/lto/ChangeLog5
-rw-r--r--gcc/lto/lto.c12
2 files changed, 15 insertions, 2 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 1d5aa14..d719217 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,8 @@
+2010-09-08 Jan Hubicka <jh@suse.cz>
+
+ * lto.c (real_file_count, real_file_decl_data): New static vars.
+ (read_cgraph_and_symbols): Use it.
+
2010-09-08 Richard Guenther <rguenther@suse.de>
* lto.c (read_cgraph_and_symbols): Collect again after each
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index 4d66a94..7478213 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -1726,6 +1726,11 @@ lto_flatten_files (struct lto_file_decl_data **orig, int count, int last_file_ix
gcc_assert (k == count);
}
+/* Input file data before flattening (i.e. splitting them to subfiles to support
+ incremental linking. */
+static int real_file_count;
+static GTY((length ("real_file_count + 1"))) struct lto_file_decl_data **real_file_decl_data;
+
/* Read all the symbols from the input files FNAMES. NFILES is the
number of files requested in the command line. Instantiate a
global call graph by aggregating all the sub-graphs found in each
@@ -1744,7 +1749,9 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
timevar_push (TV_IPA_LTO_DECL_IN);
- decl_data = (struct lto_file_decl_data **)xmalloc (sizeof(*decl_data) * (nfiles+1));
+ real_file_decl_data
+ = decl_data = ggc_alloc_cleared_vec_lto_file_decl_data_ptr (nfiles + 1);
+ real_file_count = nfiles;
/* Read the resolution file. */
resolution = NULL;
@@ -1794,7 +1801,8 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
lto_flatten_files (decl_data, count, last_file_ix);
lto_stats.num_input_files = count;
- free(decl_data);
+ ggc_free(decl_data);
+ real_file_decl_data = NULL;
if (resolution_file_name)
fclose (resolution);