diff options
author | Chris Lattner <sabre@nondot.org> | 2004-02-18 22:01:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-02-18 22:01:21 +0000 |
commit | 9709272675feaca030cce14d0f5eb7f342b3fc1d (patch) | |
tree | 34b68dd02dbdda43fa4ccabc055d65ec20f251ce /tools | |
parent | 0cc8807029f577996a442b96d24c3346ed6de091 (diff) | |
download | external_llvm-9709272675feaca030cce14d0f5eb7f342b3fc1d.zip external_llvm-9709272675feaca030cce14d0f5eb7f342b3fc1d.tar.gz external_llvm-9709272675feaca030cce14d0f5eb7f342b3fc1d.tar.bz2 |
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')
-rw-r--r-- | tools/bugpoint/ExecutionDriver.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/bugpoint/ExecutionDriver.cpp b/tools/bugpoint/ExecutionDriver.cpp index ecf9dc8..01f7be8 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; } |