summaryrefslogtreecommitdiffstats
path: root/tools/opt/opt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/opt/opt.cpp')
-rw-r--r--tools/opt/opt.cpp5
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