[llvm] r270670 - [Support] revert previous commit r270643
David Majnemer via llvm-commits
llvm-commits at lists.llvm.org
Tue May 24 23:09:06 PDT 2016
Hmm, why did this have to get reverted?
On Tue, May 24, 2016 at 10:51 PM, Gerolf Hoflehner via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
> Author: ghoflehner
> Date: Wed May 25 00:51:05 2016
> New Revision: 270670
>
> URL: http://llvm.org/viewvc/llvm-project?rev=270670&view=rev
> Log:
> [Support] revert previous commit r270643
>
> 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=270670&r1=270669&r2=270670&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Support/Unix/Signals.inc (original)
> +++ llvm/trunk/lib/Support/Unix/Signals.inc Wed May 25 00:51:05 2016
> @@ -490,3 +490,42 @@ 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
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160524/e00ea674/attachment.html>
More information about the llvm-commits
mailing list