mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-11 21:45:16 +00:00
Make the executeProgram method exception safe, not leaving around bytecode
files. llvm-svn: 11607
This commit is contained in:
parent
6e7c1e5c5c
commit
39e49b1940
@ -162,6 +162,9 @@ std::string BugDriver::executeProgram(std::string OutputFile,
|
||||
CreatedBytecode = true;
|
||||
}
|
||||
|
||||
// Remove the temporary bytecode file when we are done.
|
||||
FileRemover BytecodeFileRemover(BytecodeFile, CreatedBytecode);
|
||||
|
||||
if (OutputFile.empty()) OutputFile = "bugpoint-execution-output";
|
||||
|
||||
// Check to see if this is a valid output filename...
|
||||
@ -179,9 +182,6 @@ std::string BugDriver::executeProgram(std::string OutputFile,
|
||||
if (ProgramExitedNonzero != 0)
|
||||
*ProgramExitedNonzero = (RetVal != 0);
|
||||
|
||||
// Remove the temporary bytecode file.
|
||||
if (CreatedBytecode) removeFile(BytecodeFile);
|
||||
|
||||
// Return the filename we captured the output to.
|
||||
return OutputFile;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user