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 | c065ad850cd17ce17c83453ccb96d5dc32d84494 (patch) | |
| tree | 20536119ff49ee0c3ba515edb436270b19f9f14b /llvm/tools/gccas/gccas.cpp | |
| parent | 1c2329ade33de1693492f97a1e4e26df6d2d78cc (diff) | |
| download | bcm5719-llvm-c065ad850cd17ce17c83453ccb96d5dc32d84494.tar.gz bcm5719-llvm-c065ad850cd17ce17c83453ccb96d5dc32d84494.zip | |
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.
llvm-svn: 2303
Diffstat (limited to 'llvm/tools/gccas/gccas.cpp')
| -rw-r--r-- | llvm/tools/gccas/gccas.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/tools/gccas/gccas.cpp b/llvm/tools/gccas/gccas.cpp index 1bf1e8c0b7b..02d7cfe827f 100644 --- a/llvm/tools/gccas/gccas.cpp +++ b/llvm/tools/gccas/gccas.cpp @@ -20,6 +20,7 @@ #include "llvm/Transforms/Scalar/PromoteMemoryToRegister.h" #include "llvm/Bytecode/WriteBytecodePass.h" #include "Support/CommandLine.h" +#include "Support/Signals.h" #include <memory> #include <fstream> #include <string> @@ -64,6 +65,9 @@ int main(int argc, char **argv) { return 1; } + // Make sure that the Out file gets unlink'd from the disk if we get a SIGINT + RemoveFileOnSignal(OutputFilename); + // In addition to just parsing the input from GCC, we also want to spiff it up // a little bit. Do this now. // |

