[llvm] r270643 - [Support] Cleanup of an ancient Darwin work-around in Signals.inc (PR26174)

Gerolf Hoflehner via llvm-commits llvm-commits at lists.llvm.org
Tue May 24 17:54:40 PDT 2016


Author: ghoflehner
Date: Tue May 24 19:54:39 2016
New Revision: 270643

URL: http://llvm.org/viewvc/llvm-project?rev=270643&view=rev
Log:
[Support] Cleanup of an ancient Darwin work-around in Signals.inc (PR26174)

Patch by Jeremy Huddleston Sequoia

Modified:
    llvm/trunk/lib/Support/Unix/Signals.inc

Modified: llvm/trunk/lib/Support/Unix/Signals.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Unix/Signals.inc?rev=270643&r1=270642&r2=270643&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Unix/Signals.inc (original)
+++ llvm/trunk/lib/Support/Unix/Signals.inc Tue May 24 19:54:39 2016
@@ -490,42 +490,3 @@ void llvm::sys::PrintStackTraceOnErrorSi
   }
 #endif
 }
-
-
-/***/
-
-// On Darwin, raise sends a signal to the main thread instead of the current
-// thread. This has the unfortunate effect that assert() and abort() will end up
-// bypassing our crash recovery attempts. We work around this for anything in
-// the same linkage unit by just defining our own versions of the assert handler
-// and abort.
-
-#if defined(__APPLE__) && defined(ENABLE_CRASH_OVERRIDES)
-
-#include <signal.h>
-#include <pthread.h>
-
-int raise(int sig) {
-  return pthread_kill(pthread_self(), sig);
-}
-
-void __assert_rtn(const char *func,
-                  const char *file,
-                  int line,
-                  const char *expr) {
-  if (func)
-    fprintf(stderr, "Assertion failed: (%s), function %s, file %s, line %d.\n",
-            expr, func, file, line);
-  else
-    fprintf(stderr, "Assertion failed: (%s), file %s, line %d.\n",
-            expr, file, line);
-  abort();
-}
-
-void abort() {
-  raise(SIGABRT);
-  usleep(1000);
-  __builtin_trap();
-}
-
-#endif




More information about the llvm-commits mailing list