]> granicus.if.org Git - clang/commitdiff
If we encounter a fatal error, call the interrupt handler to ensure any
authorChad Rosier <mcrosier@apple.com>
Mon, 12 Nov 2012 19:39:37 +0000 (19:39 +0000)
committerChad Rosier <mcrosier@apple.com>
Mon, 12 Nov 2012 19:39:37 +0000 (19:39 +0000)
temporary files are removed.
rdar://12282296

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167741 91177308-0d34-0410-b5e6-96231b3b80d8

tools/driver/cc1_main.cpp

index f1968560c80f1afd820b1cc141a8b3822990e138..674f2adbbc4ee838c6fd147940b67a5fca16072f 100644 (file)
@@ -27,6 +27,7 @@
 #include "llvm/ADT/Statistic.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/ManagedStatic.h"
+#include "llvm/Support/Signals.h"
 #include "llvm/Support/TargetSelect.h"
 #include "llvm/Support/Timer.h"
 #include "llvm/Support/raw_ostream.h"
@@ -43,6 +44,10 @@ static void LLVMErrorHandler(void *UserData, const std::string &Message) {
 
   Diags.Report(diag::err_fe_error_backend) << Message;
 
+  // Run the interrupt handlers to make sure any special cleanups get done, in
+  // particular that we remove files registered with RemoveFileOnSignal.
+  llvm::sys::RunInterruptHandlers();
+
   // We cannot recover from llvm errors.
   exit(1);
 }