Provide a portability macro for __builtin_trap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162300 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie 2012-08-21 18:54:21 +00:00
parent 799aacfb27
commit 74169b293f

View File

@ -187,4 +187,13 @@
# define LLVM_BUILTIN_UNREACHABLE __builtin_unreachable()
#endif
// LLVM_BUILTIN_TRAP - On compilers which support it, expands to an expression
// which causes the program to exit abnormally.
#if defined(__clang__) || (__GNUC__ > 4) \
|| (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
# define LLVM_BUILTIN_TRAP __builtin_trap()
#else
# define LLVM_BUILTIN_TRAP *(volatile int*)0x11 = 0
#endif
#endif