mirror of
https://forge.sourceware.org/marek/gcc.git
synced 2026-02-22 03:47:02 -05:00
lto: Fix missing cleanup with incremental LTO.
Incremental LTO disabled cleanup of output_files since they have to persist in ltrans cache. This unintetionally also kept temporary early debug "*.debug.temp.o" files. Bootstrapped/regtested on x86_64-linux. Ok for trunk? lto-plugin/ChangeLog: * lto-plugin.c (cleanup_handler): Keep only files in ltrans cache.
This commit is contained in:
@@ -945,6 +945,17 @@ cleanup_handler (void)
|
||||
if (!flto_incremental)
|
||||
for (i = 0; i < num_output_files; i++)
|
||||
maybe_unlink (output_files[i]);
|
||||
else
|
||||
{
|
||||
/* Keep files in ltrans cache. */
|
||||
const char* suffix = ".ltrans.o";
|
||||
for (i = 0; i < num_output_files; i++)
|
||||
{
|
||||
int offset = strlen (output_files[i]) - strlen (suffix);
|
||||
if (offset < 0 || strcmp (output_files[i] + offset, suffix))
|
||||
maybe_unlink (output_files[i]);
|
||||
}
|
||||
}
|
||||
|
||||
free_2 ();
|
||||
return LDPS_OK;
|
||||
|
||||
Reference in New Issue
Block a user