diff options
author | Shuxin Yang <shuxin.llvm@gmail.com> | 2012-10-19 20:11:16 +0000 |
---|---|---|
committer | Shuxin Yang <shuxin.llvm@gmail.com> | 2012-10-19 20:11:16 +0000 |
commit | cdde059a34dadae84ef341149ef3014a13835976 (patch) | |
tree | 2b1e198ca89b5feda79dc351c8351aa50fd0a8c7 /llvm/include | |
parent | aa437df90a0f3d90c3be1b13408b0cd58354ca21 (diff) | |
download | bcm5719-llvm-cdde059a34dadae84ef341149ef3014a13835976.tar.gz bcm5719-llvm-cdde059a34dadae84ef341149ef3014a13835976.zip |
This patch is to fix radar://8426430. It is about llvm support of __builtin_debugtrap()
which is supposed to consistently raise SIGTRAP across all systems. In contrast,
__builtin_trap() behave differently on different systems. e.g. it raises SIGTRAP on ARM, and
SIGILL on X86. The purpose of __builtin_debugtrap() is to consistently provide "trap"
functionality, in the mean time preserve the compatibility with on gcc on __builtin_trap().
The X86 backend is already able to handle debugtrap(). This patch is to:
1) make front-end recognize "__builtin_debugtrap()" (emboddied in the one-line change to Clang).
2) In DAG legalization phase, by default, "debugtrap" will be replaced with "trap", which
make the __builtin_debugtrap() "available" to all existing ports without the hassle of
changing their code.
3) If trap-function is specified (via -trap-func=xyz to llc), both __builtin_debugtrap() and
__builtin_trap() will be expanded into the function call of the specified trap function.
This behavior may need change in the future.
The provided testing-case is to make sure 2) and 3) are working for ARM port, and we
already have a testing case for x86.
llvm-svn: 166300
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/Intrinsics.td | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/include/llvm/Intrinsics.td b/llvm/include/llvm/Intrinsics.td index 804db495566..5ccfde9e1ad 100644 --- a/llvm/include/llvm/Intrinsics.td +++ b/llvm/include/llvm/Intrinsics.td @@ -420,7 +420,7 @@ def int_flt_rounds : Intrinsic<[llvm_i32_ty]>, GCCBuiltin<"__builtin_flt_rounds">; def int_trap : Intrinsic<[], [], [IntrNoReturn]>, GCCBuiltin<"__builtin_trap">; -def int_debugtrap : Intrinsic<[]>, +def int_debugtrap : Intrinsic<[], [], [IntrNoReturn]>, GCCBuiltin<"__builtin_debugtrap">; // NOP: calls/invokes to this intrinsic are removed by codegen |