/* Actually stream out ENCODER into TEMP_FILENAME. */
static void
-do_stream_out (char *temp_filename, lto_symtab_encoder_t encoder)
+do_stream_out (char *temp_filename, lto_symtab_encoder_t encoder, int part)
{
lto_file *file = lto_obj_file_open (temp_filename, true);
if (!file)
fatal_error (input_location, "lto_obj_file_open() failed");
lto_set_current_out_file (file);
+ gcc_assert (!dump_file);
+ streamer_dump_file = dump_begin (TDI_lto_stream_out, NULL, part);
ipa_write_optimization_summaries (encoder);
free (CONST_CAST (char *, file->filename));
lto_set_current_out_file (NULL);
lto_obj_file_close (file);
free (file);
+ if (streamer_dump_file)
+ {
+ dump_end (TDI_lto_stream_out, streamer_dump_file);
+ streamer_dump_file = NULL;
+ }
}
/* Wait for forked process and signal errors. */
static void
stream_out (char *temp_filename, lto_symtab_encoder_t encoder,
- bool ARG_UNUSED (last))
+ bool ARG_UNUSED (last), int part)
{
#ifdef HAVE_WORKING_FORK
static int nruns;
if (lto_parallelism <= 1)
{
- do_stream_out (temp_filename, encoder);
+ do_stream_out (temp_filename, encoder, part);
return;
}
if (!cpid)
{
setproctitle ("lto1-wpa-streaming");
- do_stream_out (temp_filename, encoder);
+ do_stream_out (temp_filename, encoder, part);
exit (0);
}
/* Fork failed; lets do the job ourseleves. */
else if (cpid == -1)
- do_stream_out (temp_filename, encoder);
+ do_stream_out (temp_filename, encoder, part);
else
nruns++;
}
else
{
int i;
- do_stream_out (temp_filename, encoder);
+ do_stream_out (temp_filename, encoder, part);
for (i = 0; i < nruns; i++)
wait_for_child ();
}
asm_nodes_output = true;
#else
- do_stream_out (temp_filename, encoder);
+ do_stream_out (temp_filename, encoder, part);
#endif
}
}
gcc_checking_assert (lto_symtab_encoder_size (part->encoder) || !i);
- stream_out (temp_filename, part->encoder, i == n_sets - 1);
+ stream_out (temp_filename, part->encoder, i == n_sets - 1, i);
part->encoder = NULL;