summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit1f80a927d416eadb9115a0c2fd4f7e08c3851ee2 (patch)
treeb6284b7c2efb2b57b9b2513e1c769d9a90b6dd2a /llvm/tools/bugpoint/ExecutionDriver.cpp
parentb943b6b01948ca7c6f8024600d5b4047679abcbd (diff)
downloadbcm5719-llvm-1f80a927d416eadb9115a0c2fd4f7e08c3851ee2.tar.gz
bcm5719-llvm-1f80a927d416eadb9115a0c2fd4f7e08c3851ee2.zip
Make the executeProgram method exception safe, not leaving around bytecode
files. llvm-svn: 11607
Diffstat (limited to 'llvm/tools/bugpoint/ExecutionDriver.cpp')
-rw-r--r--llvm/tools/bugpoint/ExecutionDriver.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/tools/bugpoint/ExecutionDriver.cpp b/llvm/tools/bugpoint/ExecutionDriver.cpp
index ecf9dc8a582..01f7be89e35 100644
--- a/llvm/tools/bugpoint/ExecutionDriver.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud