1 //===--- Sanitizers.def - Runtime sanitizer options -------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
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.
15 //===----------------------------------------------------------------------===//
18 #error "Define SANITIZER prior to including this file!"
21 // SANITIZER(NAME, ID)
23 // The first value is the name of the sanitizer as a string. The sanitizer can
24 // be enabled by specifying -fsanitize=NAME.
26 // The second value is an identifier which can be used to refer to the
30 // SANITIZER_GROUP(NAME, ID, ALIAS)
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.
36 #ifndef SANITIZER_GROUP
37 #define SANITIZER_GROUP(NAME, ID, ALIAS)
42 SANITIZER("address", Address)
45 SANITIZER("thread", Thread)
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)
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 |
69 #undef SANITIZER_GROUP