diff options
author | Chris Lattner <sabre@nondot.org> | 2002-04-18 19:55:25 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-04-18 19:55:25 +0000 |
commit | 76d12299b5333d71bfc079614031f97c97aa5148 (patch) | |
tree | 184ef3d1792d7c134d5505b57b5525ccb688ade6 /tools/opt/opt.cpp | |
parent | bac27a49b1eb47018169dcde469d84363465aa2c (diff) | |
download | external_llvm-76d12299b5333d71bfc079614031f97c97aa5148.zip external_llvm-76d12299b5333d71bfc079614031f97c97aa5148.tar.gz external_llvm-76d12299b5333d71bfc079614031f97c97aa5148.tar.bz2 |
Make sure that there is no case where a signal can occur leaving a partially
written output file. This is important because crashing testcases often write
part of a file out, and the testing harness decides the file is up-to-date next
time the test is run.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2303 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/opt/opt.cpp')
-rw-r--r-- | tools/opt/opt.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index f922dd8..f08567a 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -31,6 +31,7 @@ #include "llvm/Transforms/Instrumentation/TraceValues.h" #include "llvm/Transforms/Instrumentation/ProfilePaths.h" #include "Support/CommandLine.h" +#include "Support/Signals.h" #include <fstream> #include <memory> @@ -174,6 +175,10 @@ int main(int argc, char **argv) { cerr << "Error opening " << OutputFilename << "!\n"; return 1; } + + // Make sure that the Output file gets unlink'd from the disk if we get a + // SIGINT + RemoveFileOnSignal(OutputFilename); } // Create a PassManager to hold and optimize the collection of passes we are |