file_data = XCNEW (struct lto_file_decl_data);
file_data->file_name = file->filename;
- file_data->section_hash_table = lto_elf_build_section_table (file);
+ file_data->section_hash_table = lto_obj_build_section_table (file);
file_data->renaming_hash_table = lto_create_renaming_table ();
data = lto_get_section_data (file_data, LTO_section_decls, NULL, &len);
}
else if (TREE_CODE (t) == FUNCTION_DECL && !TREE_PUBLIC (t))
{
- if (!cgraph_node_in_set_p (cgraph_node (t), context->set))
+ if (!cgraph_node_in_set_p (cgraph_node (t), context->set)
+ || cgraph_node (t)->address_taken)
{
/* This file-scope static function is reachable from a set
which does not contain the function DECL. Make it global
if (cgraph_node_set_needs_ltrans_p (set))
{
/* Write all the nodes in SET to TEMP_FILENAME. */
- file = lto_elf_file_open (temp_filename, true);
+ file = lto_obj_file_open (temp_filename, true);
if (!file)
- fatal_error ("lto_elf_file_open() failed");
+ fatal_error ("lto_obj_file_open() failed");
lto_set_current_out_file (file);
- ipa_write_summaries_of_cgraph_node_set (set);
+ ipa_write_optimization_summaries (set);
lto_set_current_out_file (NULL);
- lto_elf_file_close (file);
+ lto_obj_file_close (file);
}
}
if (t != prevailing)
{
- if (TREE_CODE (t) == FUNCTION_DECL
- && TREE_NOTHROW (prevailing) != TREE_NOTHROW (t))
- {
- /* If the prevailing definition does not throw but the
- declaration (T) was considered throwing, then we
- simply add PREVAILING to the list of throwing
- functions. However, if the opposite is true, then
- the call to PREVAILING was generated assuming that
- the function didn't throw, which means that CFG
- cleanup may have removed surrounding try/catch
- regions.
-
- Note that we currently accept these cases even when
- they occur within a single file. It's certainly a
- user error, but we silently allow the compiler to
- remove surrounding try/catch regions. Perhaps we
- could emit a warning here, instead of silently
- accepting the conflicting declaration. */
- if (TREE_NOTHROW (prevailing))
- lto_mark_nothrow_fndecl (prevailing);
- }
-
/* Also replace t with prevailing defintion. We don't want to
insert the other defintion in the seen set as we want to
replace all instances of it. */
for (i = 0; i < num_in_fnames; i++)
{
struct lto_file_decl_data *file_data;
- lto_file *file = lto_elf_file_open (in_fnames[i], false);
+ lto_file *file = lto_obj_file_open (in_fnames[i], false);
if (!file)
break;
file_data = XCNEW (struct lto_file_decl_data);
file_data->file_name = file->filename;
- file_data->section_hash_table = lto_elf_build_section_table (file);
+ file_data->section_hash_table = lto_obj_build_section_table (file);
lto_read_file_options (file_data);
- lto_elf_file_close (file);
+ lto_obj_file_close (file);
htab_delete (file_data->section_hash_table);
free (file_data);
}
gcc_assert (num_objects == nfiles);
}
+ if (!quiet_flag)
+ fprintf (stderr, "Reading object files:");
+
/* Read all of the object files specified on the command line. */
for (i = 0, last_file_ix = 0; i < nfiles; ++i)
{
struct lto_file_decl_data *file_data = NULL;
+ if (!quiet_flag)
+ {
+ fprintf (stderr, " %s", fnames[i]);
+ fflush (stderr);
+ }
- current_lto_file = lto_elf_file_open (fnames[i], false);
+ current_lto_file = lto_obj_file_open (fnames[i], false);
if (!current_lto_file)
break;
all_file_decl_data[last_file_ix++] = file_data;
- lto_elf_file_close (current_lto_file);
+ lto_obj_file_close (current_lto_file);
current_lto_file = NULL;
}
/* Each pass will set the appropriate timer. */
timevar_pop (TV_IPA_LTO_DECL_IO);
+ if (!quiet_flag)
+ fprintf (stderr, "\nReading the callgraph\n");
+
/* Read the callgraph. */
input_cgraph ();
+ if (!quiet_flag)
+ fprintf (stderr, "Merging declarations\n");
+
/* Merge global decls. */
lto_symtab_merge_decls ();
lto_fixup_decls (all_file_decl_data);
free_gimple_type_tables ();
+ if (!quiet_flag)
+ fprintf (stderr, "Reading summaries\n");
+
/* Read the IPA summary data. */
- ipa_read_summaries ();
+ if (flag_ltrans)
+ ipa_read_optimization_summaries ();
+ else
+ ipa_read_summaries ();
/* Finally merge the cgraph according to the decl merging decisions. */
lto_symtab_merge_cgraph_nodes ();
unsigned i;
timevar_id_t lto_timer;
+ if (!quiet_flag)
+ fprintf (stderr,
+ flag_wpa ? "Materializing decls:" : "Reading function bodies:");
+
+
/* Now that we have input the cgraph, we need to clear all of the aux
nodes and read the functions if we are not running in WPA mode. */
timevar_push (TV_IPA_LTO_GIMPLE_IO);
if (node->local.lto_file_data
&& !DECL_IS_BUILTIN (node->decl))
{
+ announce_function (node->decl);
lto_materialize_function (node);
lto_stats.num_input_cgraph_nodes++;
}
for (i = 0; VEC_iterate (tree, lto_global_var_decls, i, decl); i++)
rest_of_decl_compilation (decl, 1, 0);
- /* Fix up any calls to DECLs that have become not exception throwing. */
- lto_fixup_nothrow_decls ();
+ if (!quiet_flag)
+ fprintf (stderr, "\n");
timevar_pop (lto_timer);
}
lto_1_to_1_map ();
+ if (!quiet_flag)
+ {
+ fprintf (stderr, "\nStreaming out");
+ fflush (stderr);
+ }
output_files = lto_wpa_write_files ();
+ if (!quiet_flag)
+ fprintf (stderr, "\n");
/* Show the LTO report before launching LTRANS. */
if (flag_lto_report)