diff options
author | Jan Hubicka <jh@suse.cz> | 2010-04-30 20:44:41 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2010-04-30 18:44:41 +0000 |
commit | ace72c88c59513b361ce1cfffed07e14990b6bba (patch) | |
tree | cb91ee477b569e52145f60b6fcf1d8acc58becd3 /gcc/lto | |
parent | bf65e4b1840a177da33775556f9b7f7eecf66fc4 (diff) | |
download | gcc-ace72c88c59513b361ce1cfffed07e14990b6bba.zip gcc-ace72c88c59513b361ce1cfffed07e14990b6bba.tar.gz gcc-ace72c88c59513b361ce1cfffed07e14990b6bba.tar.bz2 |
lto.c (get_filename_for_set): Look for cgraph node and if none found, use default name.
* lto.c (get_filename_for_set): Look for cgraph node and if none found, use
default name.
(lto_wpa_write_files): Write any non-empty partition.
* cgraph.h (cgraph_node_set_nonempty_p, varpool_node_set_nonempty_p): New.
* lto-cgraph.c (input_cgraph): Remove call to lto_mark_file_for_ltrans.
* lto-streamer.h (lto_file_decl_data): Remove needs_ltrans_p.
(lto_file_needs_ltrans_p, lto_mark_file_for_ltrans,
cgraph_node_set_needs_ltrans_p): Remove.
From-SVN: r158943
Diffstat (limited to 'gcc/lto')
-rw-r--r-- | gcc/lto/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/lto/lto.c | 88 |
2 files changed, 50 insertions, 44 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 78452a7..c17da3b 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,5 +1,11 @@ 2010-04-30 Jan Hubicka <jh@suse.cz> + * lto.c (get_filename_for_set): Look for cgraph node and if none found, use + default name. + (lto_wpa_write_files): Write any non-empty partition. + +2010-04-30 Jan Hubicka <jh@suse.cz> + * lto.c: Do not attempt to make constant pool references global. 2010-04-28 Jan Hubicka <jh@suse.cz> diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 18fef05..d306580 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -817,57 +817,50 @@ get_filename_for_set (cgraph_node_set set) 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 @@ -876,6 +869,13 @@ get_filename_for_set (cgraph_node_set set) 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; } @@ -933,7 +933,7 @@ lto_wpa_write_files (void) 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); |