1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

Now use the __debugbreak intrinsic instead of calling RaiseException; it requires no forward declares and still calls VEH.

llvm-svn: 228745
This commit is contained in:
Aaron Ballman 2015-02-10 21:13:04 +00:00
parent 609bd5e8bc
commit e5024a035a

View File

@ -287,19 +287,12 @@
/// which causes the program to exit abnormally.
#if __has_builtin(__builtin_trap) || LLVM_GNUC_PREREQ(4, 3, 0)
# define LLVM_BUILTIN_TRAP __builtin_trap()
#elif defined(LLVM_ON_WIN32)
#if defined(_WIN64)
extern "C" __declspec(dllimport) void __stdcall RaiseException(
unsigned long, unsigned long, unsigned long, const unsigned long long *);
#else
extern "C" __declspec(dllimport) void __stdcall RaiseException(
unsigned long, unsigned long, unsigned long, const unsigned long *);
#endif
# define LLVM_BUILTIN_TRAP \
do { \
::RaiseException(0x8000DEAD, 0x1 /*EXCEPTION_NONCONTINUABLE*/, 0, nullptr);\
__assume(false); \
} while (0)
#elif defined(_MSC_VER)
// The __debugbreak intrinsic is supported by MSVC, does not require forward
// declarations involving platform-specific typedefs (unlike RaiseException),
// results in a call to vectored exception handlers, and encodes to a short
// instruction that still causes the trapping behavior we want.
# define LLVM_BUILTIN_TRAP __debugbreak()
#else
# define LLVM_BUILTIN_TRAP *(volatile int*)0x11 = 0
#endif