When a trapping sanitizer is deployed in release configurations, you might have limited ability to get information back from crashes. This patch makes Clang emit a different kind of trap, firstly for UBSAN compared to any other reason we might trap, but also for its different failure modes.
A crash-dumping program can then inspect the opcode and give you, if not a truly specific diagnosis, at least a function and what kind of thing to look for which is often enough to diagnose the problem.
Because of the extra traps there is a small code-size penalty, but it's pretty small compared to what we accept just for the sanitization so probably not a big concern (57.0% overhead as opposed to 55.7% currently on SPEC, for AArch64),
For now I've implemented the new kind of trap for AArch64 and X86, with fallback to a default trap elsewhere.
'per check, per function'?