]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/llvm/tools/clang/include/clang/Basic/Sanitizers.def
MFC r244628:
[FreeBSD/stable/9.git] / contrib / llvm / tools / clang / include / clang / Basic / Sanitizers.def
1 //===--- Sanitizers.def - Runtime sanitizer options -------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines the options for specifying which runtime sanitizers to
11 // enable. Users of this file must define the SANITIZER macro to make use of
12 // this information. Users of this file can also define the SANITIZER_GROUP
13 // macro to get information on options which refer to sets of sanitizers.
14 //
15 //===----------------------------------------------------------------------===//
16
17 #ifndef SANITIZER
18 #error "Define SANITIZER prior to including this file!"
19 #endif
20
21 // SANITIZER(NAME, ID)
22
23 // The first value is the name of the sanitizer as a string. The sanitizer can
24 // be enabled by specifying -fsanitize=NAME.
25
26 // The second value is an identifier which can be used to refer to the
27 // sanitizer.
28
29
30 // SANITIZER_GROUP(NAME, ID, ALIAS)
31
32 // The first two values have the same semantics as the corresponding SANITIZER
33 // values. The third value is an expression ORing together the IDs of individual
34 // sanitizers in this group.
35
36 #ifndef SANITIZER_GROUP
37 #define SANITIZER_GROUP(NAME, ID, ALIAS)
38 #endif
39
40
41 // AddressSanitizer
42 SANITIZER("address", Address)
43
44 // ThreadSanitizer
45 SANITIZER("thread", Thread)
46
47 // UndefinedBehaviorSanitizer
48 SANITIZER("signed-integer-overflow", SignedIntegerOverflow)
49 SANITIZER("divide-by-zero", DivideByZero)
50 SANITIZER("shift", Shift)
51 SANITIZER("unreachable", Unreachable)
52 SANITIZER("return", Return)
53 SANITIZER("vla-bound", VLABound)
54 SANITIZER("alignment", Alignment)
55 SANITIZER("null", Null)
56 SANITIZER("vptr", Vptr)
57 SANITIZER("object-size", ObjectSize)
58 SANITIZER("float-cast-overflow", FloatCastOverflow)
59
60 // -fsanitize=undefined (and its alias -fcatch-undefined-behavior). This should
61 // include all the sanitizers which have low overhead, no ABI or address space
62 // layout implications, and only catch undefined behavior.
63 SANITIZER_GROUP("undefined", Undefined,
64                 SignedIntegerOverflow | DivideByZero | Shift | Unreachable |
65                 Return | VLABound | Alignment | Null | Vptr | ObjectSize |
66                 FloatCastOverflow)
67
68 #undef SANITIZER
69 #undef SANITIZER_GROUP