diff options
author | Chris Lattner <sabre@nondot.org> | 2004-05-12 02:55:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-05-12 02:55:45 +0000 |
commit | af24e90c512e9d1b583548c8ddcfa127f68cfb45 (patch) | |
tree | 1ce27bd2ca7d641249a1bc0b48692379b774e043 | |
parent | 5ed8cf5f1e672a693ef161c49dd9f006fac3e9bb (diff) | |
download | bcm5719-llvm-af24e90c512e9d1b583548c8ddcfa127f68cfb45.tar.gz bcm5719-llvm-af24e90c512e9d1b583548c8ddcfa127f68cfb45.zip |
Don't leave dead bytecode.output files around if the optimizer/block extractor crashes.
llvm-svn: 13477
-rw-r--r-- | llvm/tools/bugpoint/OptimizerDriver.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/tools/bugpoint/OptimizerDriver.cpp b/llvm/tools/bugpoint/OptimizerDriver.cpp index ad69caaec6e..c5c437ccdb8 100644 --- a/llvm/tools/bugpoint/OptimizerDriver.cpp +++ b/llvm/tools/bugpoint/OptimizerDriver.cpp @@ -135,13 +135,12 @@ bool BugDriver::runPasses(const std::vector<const PassInfo*> &Passes, exit(1); } - // If we are supposed to delete the bytecode file, remove it now - // unconditionally... this may fail if the file was never created, but that's - // ok. - if (DeleteOutput) - removeFile(OutputFilename); - bool ExitedOK = WIFEXITED(Status) && WEXITSTATUS(Status) == 0; + + // If we are supposed to delete the bytecode file or if the passes crashed, + // remove it now. This may fail if the file was never created, but that's ok. + if (DeleteOutput || !ExitedOK) + removeFile(OutputFilename); if (!Quiet) { if (ExitedOK) |