aboutsummaryrefslogtreecommitdiff
path: root/gcc/jit/jit-playback.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/jit/jit-playback.c')
-rw-r--r--gcc/jit/jit-playback.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c
index ee129ae..d150ec1 100644
--- a/gcc/jit/jit-playback.c
+++ b/gcc/jit/jit-playback.c
@@ -1888,6 +1888,7 @@ playback::compile_to_file::postprocess (const char *ctxt_progname)
case GCC_JIT_OUTPUT_KIND_ASSEMBLER:
copy_file (get_tempdir ()->get_path_s_file (),
m_output_path);
+ /* The .s file is automatically unlinked by tempdir::~tempdir. */
break;
case GCC_JIT_OUTPUT_KIND_OBJECT_FILE:
@@ -1902,9 +1903,13 @@ playback::compile_to_file::postprocess (const char *ctxt_progname)
false, /* bool shared, */
false);/* bool run_linker */
if (!errors_occurred ())
- copy_file (tmp_o_path,
- m_output_path);
- free (tmp_o_path);
+ {
+ copy_file (tmp_o_path,
+ m_output_path);
+ get_tempdir ()->add_temp_file (tmp_o_path);
+ }
+ else
+ free (tmp_o_path);
}
break;
@@ -1918,6 +1923,7 @@ playback::compile_to_file::postprocess (const char *ctxt_progname)
if (!errors_occurred ())
copy_file (get_tempdir ()->get_path_so_file (),
m_output_path);
+ /* The .so file is automatically unlinked by tempdir::~tempdir. */
break;
case GCC_JIT_OUTPUT_KIND_EXECUTABLE:
@@ -1932,9 +1938,13 @@ playback::compile_to_file::postprocess (const char *ctxt_progname)
false, /* bool shared, */
true);/* bool run_linker */
if (!errors_occurred ())
- copy_file (tmp_exe_path,
- m_output_path);
- free (tmp_exe_path);
+ {
+ copy_file (tmp_exe_path,
+ m_output_path);
+ get_tempdir ()->add_temp_file (tmp_exe_path);
+ }
+ else
+ free (tmp_exe_path);
}
break;
@@ -2279,7 +2289,7 @@ extract_any_requested_dumps (vec <recording::requested_dump> *requested_dumps)
filename = g->get_dumps ()->get_dump_file_name (dfi);
content = read_dump_file (filename);
*(d->m_out_ptr) = content;
- free (filename);
+ m_tempdir->add_temp_file (filename);
}
}