If we encounter a fatal error, call the interrupt handler to ensure any

temporary files are removed.
rdar://12282296

llvm-svn: 167741
This commit is contained in:
Chad Rosier 2012-11-12 19:39:37 +00:00
parent 1c442f5ec6
commit 7ea7397ebc
1 changed files with 5 additions and 0 deletions

View 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);
}