diff options
author | Chad Rosier <mcrosier@apple.com> | 2012-11-12 19:39:37 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2012-11-12 19:39:37 +0000 |
commit | b0afe833e41cac21ded36a4d98df502fa5b3d758 (patch) | |
tree | 9f186696ef5df899c4a5a0532c96a836f335e8f1 /tools/driver/cc1_main.cpp | |
parent | 731de313f759bdb412d38df3d2a0f149437ef401 (diff) |
If we encounter a fatal error, call the interrupt handler to ensure any
temporary files are removed.
rdar://12282296
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167741 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/driver/cc1_main.cpp')
-rw-r--r-- | tools/driver/cc1_main.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/driver/cc1_main.cpp b/tools/driver/cc1_main.cpp index f1968560c8..674f2adbbc 100644 --- a/tools/driver/cc1_main.cpp +++ b/tools/driver/cc1_main.cpp @@ -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); } |