/* The .o file that these offsets relate to. */
const char *GTY((skip)) file_name;
- /* Nonzero if this file should be recompiled with LTRANS. */
- unsigned needs_ltrans_p : 1;
-
/* Hash table maps lto-related section names to location in file. */
htab_t GTY((skip)) section_hash_table;
return (enum tree_code) ((unsigned) tag - 1);
}
-
-/* Return true if FILE needs to be compiled with LTRANS. */
-static inline bool
-lto_file_needs_ltrans_p (struct lto_file_decl_data *file)
-{
- return file->needs_ltrans_p != 0;
-}
-
-
-/* Mark FILE to be compiled with LTRANS. */
-static inline void
-lto_mark_file_for_ltrans (struct lto_file_decl_data *file)
-{
- file->needs_ltrans_p = 1;
-}
-
-
-/* Return true if any files in node set SET need to be compiled
- with LTRANS. */
-static inline bool
-cgraph_node_set_needs_ltrans_p (cgraph_node_set set)
-{
- cgraph_node_set_iterator csi;
-
- for (csi = csi_start (set); !csi_end_p (csi); csi_next (&csi))
- if (lto_file_needs_ltrans_p (csi_node (csi)->local.lto_file_data))
- return true;
-
- return false;
-}
-
-
/* Initialize an lto_out_decl_buffer ENCODER. */
static inline void
lto_init_tree_ref_encoder (struct lto_tree_ref_encoder *encoder,
char *fname = NULL;
static const size_t max_fname_len = 100;
- if (cgraph_node_set_needs_ltrans_p (set))
+ /* Create a new temporary file to store SET. To facilitate
+ debugging, use file names from SET as part of the new
+ temporary file name. */
+ cgraph_node_set_iterator si;
+ struct pointer_set_t *pset = pointer_set_create ();
+ for (si = csi_start (set); !csi_end_p (si); csi_next (&si))
{
- /* Create a new temporary file to store SET. To facilitate
- debugging, use file names from SET as part of the new
- temporary file name. */
- cgraph_node_set_iterator si;
- struct pointer_set_t *pset = pointer_set_create ();
- for (si = csi_start (set); !csi_end_p (si); csi_next (&si))
- {
- struct cgraph_node *n = csi_node (si);
- const char *node_fname;
- char *f;
+ struct cgraph_node *n = csi_node (si);
+ const char *node_fname;
+ char *f;
- /* Don't use the same file name more than once. */
- if (pointer_set_insert (pset, n->local.lto_file_data))
- continue;
+ /* Don't use the same file name more than once. */
+ if (pointer_set_insert (pset, n->local.lto_file_data))
+ continue;
- /* The first file name found in SET determines the output
- directory. For the remaining files, we use their
- base names. */
- node_fname = n->local.lto_file_data->file_name;
- if (fname == NULL)
- {
- fname = strip_extension (node_fname);
- continue;
- }
+ /* The first file name found in SET determines the output
+ directory. For the remaining files, we use their
+ base names. */
+ node_fname = n->local.lto_file_data->file_name;
+ if (fname == NULL)
+ {
+ fname = strip_extension (node_fname);
+ continue;
+ }
- f = strip_extension (lbasename (node_fname));
+ f = strip_extension (lbasename (node_fname));
- /* If the new name causes an excessively long file name,
- make the last component "___" to indicate overflow. */
- if (strlen (fname) + strlen (f) > max_fname_len - 3)
- {
- fname = reconcat (fname, fname, "___", NULL);
- break;
- }
- else
- {
- fname = reconcat (fname, fname, "_", f, NULL);
- free (f);
- }
+ /* If the new name causes an excessively long file name,
+ make the last component "___" to indicate overflow. */
+ if (strlen (fname) + strlen (f) > max_fname_len - 3)
+ {
+ fname = reconcat (fname, fname, "___", NULL);
+ break;
+ }
+ else
+ {
+ fname = reconcat (fname, fname, "_", f, NULL);
+ free (f);
}
+ }
- pointer_set_destroy (pset);
+ pointer_set_destroy (pset);
- /* Add the extension .wpa.o to indicate that this file has been
- produced by WPA. */
- fname = reconcat (fname, fname, ".wpa.o", NULL);
- gcc_assert (fname);
- }
- else
+ if (!fname)
{
/* Since SET does not need to be processed by LTRANS, use
the original file name and mark it with a '*' prefix so that
struct cgraph_node *first = csi_node (si);
fname = prefix_name_with_star (first->local.lto_file_data->file_name);
}
+ else
+ {
+ /* Add the extension .wpa.o to indicate that this file has been
+ produced by WPA. */
+ fname = reconcat (fname, fname, ".wpa.o", NULL);
+ gcc_assert (fname);
+ }
return fname;
}
temp_filename = get_filename_for_set (set);
output_files[i] = temp_filename;
- if (cgraph_node_set_needs_ltrans_p (set))
+ if (cgraph_node_set_nonempty_p (set) || varpool_node_set_nonempty_p (vset))
{
/* Write all the nodes in SET to TEMP_FILENAME. */
file = lto_obj_file_open (temp_filename, true);