[Driver] Preserve filelists when a subprocess crashes. (#9849)

This should make it easier to rerun crashed jobs that use filelists;
previously you'd have to run the top-level driver command again with
-save-temps. I didn't want to save /all/ temporary files because that
often includes things like .o files, which could fill up your disk
pretty quickly. But we can always tweak this later.
This commit is contained in:
Jordan Rose
2017-05-22 17:14:20 -07:00
committed by GitHub
parent ae984977e0
commit a875d8c7c7
8 changed files with 66 additions and 25 deletions

View File

@@ -57,7 +57,7 @@ ToolChain::JobContext::getTemporaryFilePath(const llvm::Twine &name,
llvm::report_fatal_error("unable to create temporary file for filelist");
}
C.addTemporaryFile(buffer.str());
C.addTemporaryFile(buffer.str(), PreserveOnSignal::Yes);
// We can't just reference the data in the TemporaryFiles vector because
// that could theoretically get copied to a new address.
return C.getArgs().MakeArgString(buffer.str());