Skip to content
Snippets Groups Projects
Commit b0afe833 authored by Chad Rosier's avatar Chad Rosier
Browse files

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
parent 731de313
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "llvm/ADT/Statistic.h" #include "llvm/ADT/Statistic.h"
#include "llvm/Support/ErrorHandling.h" #include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ManagedStatic.h" #include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/TargetSelect.h" #include "llvm/Support/TargetSelect.h"
#include "llvm/Support/Timer.h" #include "llvm/Support/Timer.h"
#include "llvm/Support/raw_ostream.h" #include "llvm/Support/raw_ostream.h"
...@@ -43,6 +44,10 @@ static void LLVMErrorHandler(void *UserData, const std::string &Message) { ...@@ -43,6 +44,10 @@ static void LLVMErrorHandler(void *UserData, const std::string &Message) {
Diags.Report(diag::err_fe_error_backend) << 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. // We cannot recover from llvm errors.
exit(1); exit(1);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment