HomePhabricator

This patch is to fix radar://8426430. It is about llvm support of…
rL166300Unpublished

Unpublished Commit · Learn More

No further details are available.

Description

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.

Details

Committed
shuxin_yangOct 19 2012, 1:11 PM
Parents
rL166299: IRgen: Initialize TargetLoweringInfo with a triple.
Branches
Unknown
Tags
Unknown

Event Timeline