diff options
author | Chad Rosier <mcrosier@apple.com> | 2013-01-29 23:31:22 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2013-01-29 23:31:22 +0000 |
commit | 78d85b1c5830a881c0a20a1b3fea99ee73149590 (patch) | |
tree | 10eaec603fd207c4c2603ab89586a7cf5e957c8f /include/clang/Basic/Sanitizers.def | |
parent | 13e42fb10b225cb3eed7e6e4c6bbe2fff1127407 (diff) |
[ubsan] Implement the -fcatch-undefined-behavior flag using a trapping
implementation; this is much more inline with the original implementation
(i.e., pre-ubsan) and does not require run-time library support.
The trapping implementation can be invoked using either '-fcatch-undefined-behavior'
or '-fsanitize=undefined-trap -fsanitize-undefined-trap-on-error', with the latter
being preferred. Eventually, the -fcatch-undefined-behavior' flag will be removed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173848 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/Sanitizers.def')
-rw-r--r-- | include/clang/Basic/Sanitizers.def | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/include/clang/Basic/Sanitizers.def b/include/clang/Basic/Sanitizers.def index 3e02b3ac14..709ec8d037 100644 --- a/include/clang/Basic/Sanitizers.def +++ b/include/clang/Basic/Sanitizers.def @@ -74,15 +74,24 @@ SANITIZER("vptr", Vptr) // IntegerSanitizer SANITIZER("unsigned-integer-overflow", UnsignedIntegerOverflow) -// -fsanitize=undefined (and its alias -fcatch-undefined-behavior). This should -// include all the sanitizers which have low overhead, no ABI or address space -// layout implications, and only catch undefined behavior. +// -fsanitize=undefined includes all the sanitizers which have low overhead, no +// ABI or address space layout implications, and only catch undefined behavior. SANITIZER_GROUP("undefined", Undefined, Alignment | Bool | Bounds | Enum | FloatCastOverflow | FloatDivideByZero | IntegerDivideByZero | Null | ObjectSize | Return | Shift | SignedIntegerOverflow | Unreachable | VLABound | Vptr) +// -fsanitize=undefined-trap (and its alias -fcatch-undefined-behavior) includes +// all sanitizers included by -fsanitize=undefined, except those that require +// runtime support. This group is generally used in conjunction with the +// -fsanitize-undefined-trap-on-error flag. +SANITIZER_GROUP("undefined-trap", UndefinedTrap, + Alignment | Bool | Bounds | Enum | FloatCastOverflow | + FloatDivideByZero | IntegerDivideByZero | Null | ObjectSize | + Return | Shift | SignedIntegerOverflow | Unreachable | + VLABound) + SANITIZER_GROUP("integer", Integer, SignedIntegerOverflow | UnsignedIntegerOverflow | Shift | IntegerDivideByZero) |