static std::vector<std::pair<void(*)(void*), void*> > *CallBacksToRun = 0;
static bool RegisteredUnhandledExceptionFilter = false;
static bool CleanupExecuted = false;
-#ifdef _MSC_VER
static bool ExitOnUnhandledExceptions = false;
-#endif
static PTOP_LEVEL_EXCEPTION_FILTER OldFilter = NULL;
// Windows creates a new thread to execute the console handler when an event
SetConsoleCtrlHandler(LLVMConsoleCtrlHandler, TRUE);
// Environment variable to disable any kind of crash dialog.
-#ifdef _MSC_VER
if (getenv("LLVM_DISABLE_CRT_DEBUG")) {
+#ifdef _MSC_VER
_CrtSetReportHook(CRTReportHook);
+#endif
ExitOnUnhandledExceptions = true;
}
-#endif
// IMPORTANT NOTE: Caller must call LeaveCriticalSection(&CriticalSection) or
// else multi-threading problems will ensue.
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)