summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-09-22 15:58:35 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-09-22 15:58:35 +0000
commit1bdedd38768056e003cbf5e4b3b5eb5a0cc21a86 (patch)
treecc1cea931d6e0c34242392d2f160f3c50610a0ab /llvm/lib/System
parentcabea40ea3c9b97d213080618e612eb41bcc96e5 (diff)
downloadbcm5719-llvm-1bdedd38768056e003cbf5e4b3b5eb5a0cc21a86.tar.gz
bcm5719-llvm-1bdedd38768056e003cbf5e4b3b5eb5a0cc21a86.zip
Hide MSVC specific CRT interaction behind _MSC_VER.
llvm-svn: 82551
Diffstat (limited to 'llvm/lib/System')
-rw-r--r--llvm/lib/System/Win32/Signals.inc8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/System/Win32/Signals.inc b/llvm/lib/System/Win32/Signals.inc
index 699df769f9b..ca43bbf5972 100644
--- a/llvm/lib/System/Win32/Signals.inc
+++ b/llvm/lib/System/Win32/Signals.inc
@@ -58,6 +58,7 @@ namespace llvm {
//=== and must not be UNIX code
//===----------------------------------------------------------------------===//
+#ifdef _MSC_VER
/// CRTReportHook - Function called on a CRT debugging event.
static int CRTReportHook(int ReportType, char *Message, int *Return) {
// Don't cause a DebugBreak() on return.
@@ -86,6 +87,7 @@ static int CRTReportHook(int ReportType, char *Message, int *Return) {
// Don't call _CrtDbgReport.
return TRUE;
}
+#endif
static void RegisterHandler() {
if (RegisteredUnhandledExceptionFilter) {
@@ -106,10 +108,12 @@ static void RegisterHandler() {
SetConsoleCtrlHandler(LLVMConsoleCtrlHandler, TRUE);
// Environment variable to disable any kind of crash dialog.
+#ifdef _MSC_VER
if (getenv("LLVM_DISABLE_CRT_DEBUG")) {
_CrtSetReportHook(CRTReportHook);
- ExitOnUnhandledExceptions = true;
+ ExitOnUnhandledExceptions = true;
}
+#endif
// IMPORTANT NOTE: Caller must call LeaveCriticalSection(&CriticalSection) or
// else multi-threading problems will ensue.
@@ -270,8 +274,10 @@ static LONG WINAPI LLVMUnhandledExceptionFilter(LPEXCEPTION_POINTERS ep) {
assert(0 && "Crashed in LLVMUnhandledExceptionFilter");
}
+#ifdef _MSC_VER
if (ExitOnUnhandledExceptions)
_exit(-3);
+#endif
// Allow dialog box to pop up allowing choice to start debugger.
if (OldFilter)
OpenPOWER on IntegriCloud