summaryrefslogtreecommitdiff
path: root/tools/bugpoint/ExecutionDriver.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-02-18 22:01:21 +0000
committerChris Lattner <sabre@nondot.org>2004-02-18 22:01:21 +0000
commit9709272675feaca030cce14d0f5eb7f342b3fc1d (patch)
tree34b68dd02dbdda43fa4ccabc055d65ec20f251ce /tools/bugpoint/ExecutionDriver.cpp
parent0cc8807029f577996a442b96d24c3346ed6de091 (diff)
downloadllvm-9709272675feaca030cce14d0f5eb7f342b3fc1d.tar.gz
llvm-9709272675feaca030cce14d0f5eb7f342b3fc1d.tar.bz2
llvm-9709272675feaca030cce14d0f5eb7f342b3fc1d.tar.xz
Make the executeProgram method exception safe, not leaving around bytecode
files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11607 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/ExecutionDriver.cpp')
-rw-r--r--tools/bugpoint/ExecutionDriver.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/bugpoint/ExecutionDriver.cpp b/tools/bugpoint/ExecutionDriver.cpp
index ecf9dc8a58..01f7be89e3 100644
--- a/tools/bugpoint/ExecutionDriver.cpp
+++ b/tools/bugpoint/ExecutionDriver.cpp
@@ -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;
}