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/llvm-as/llvm-as.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/llvm-as/llvm-as.cpp')
-rw-r--r-- | llvm/tools/llvm-as/llvm-as.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/tools/llvm-as/llvm-as.cpp b/llvm/tools/llvm-as/llvm-as.cpp index 7bea711826e..3e8a9eaf31a 100644 --- a/llvm/tools/llvm-as/llvm-as.cpp +++ b/llvm/tools/llvm-as/llvm-as.cpp @@ -13,6 +13,7 @@ #include "llvm/Assembly/Parser.h" #include "llvm/Bytecode/Writer.h" #include "Support/CommandLine.h" +#include "Support/Signals.h" #include <fstream> #include <string> #include <memory> @@ -70,6 +71,9 @@ int main(int argc, char **argv) { } Out = new std::ofstream(OutputFilename.c_str()); + // Make sure that the Out file gets unlink'd from the disk if we get a + // SIGINT + RemoveFileOnSignal(OutputFilename); } } |