aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-05-08 02:10:36 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-05-08 02:10:36 +0000
commit476f4aeac7b79103a10e8817d22b797fe633c1e2 (patch)
tree71805a26f3f3dab60afe4a83731bded585d48199 /lib/Support
parente85dfda3fa8db238a26c479b017cffc0e3eb43d7 (diff)
downloadexternal_llvm-476f4aeac7b79103a10e8817d22b797fe633c1e2.zip
external_llvm-476f4aeac7b79103a10e8817d22b797fe633c1e2.tar.gz
external_llvm-476f4aeac7b79103a10e8817d22b797fe633c1e2.tar.bz2
Run interrupt routines as part of report_fatal_error, since we are failing
ungracefully. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103334 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/ErrorHandling.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Support/ErrorHandling.cpp b/lib/Support/ErrorHandling.cpp
index 56a171c..7e7ca9d 100644
--- a/lib/Support/ErrorHandling.cpp
+++ b/lib/Support/ErrorHandling.cpp
@@ -16,6 +16,7 @@
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
+#include "llvm/System/Signals.h"
#include "llvm/System/Threading.h"
#include <cassert>
#include <cstdlib>
@@ -52,6 +53,12 @@ void llvm::report_fatal_error(const Twine &reason) {
} else {
ErrorHandler(ErrorHandlerUserData, reason.str());
}
+
+ // If we reached here, we are failing ungracefully. Run the interrupt handlers
+ // to make sure any special cleanups get done, in particular that we remove
+ // files registered with RemoveFileOnSignal.
+ sys::RunInterruptHandlers();
+
exit(1);
}