Warning: That file was not part of the compilation database. It may have many parsing errors.
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 | // Kernel AddressSanitizer (KASan) |
45 | SANITIZER("kernel-address", KernelAddress) |
46 | |
47 | // Hardware-assisted AddressSanitizer |
48 | SANITIZER("hwaddress", HWAddress) |
49 | |
50 | // Kernel Hardware-assisted AddressSanitizer (KHWASan) |
51 | SANITIZER("kernel-hwaddress", KernelHWAddress) |
52 | |
53 | // MemorySanitizer |
54 | SANITIZER("memory", Memory) |
55 | |
56 | // libFuzzer |
57 | SANITIZER("fuzzer", Fuzzer) |
58 | |
59 | // libFuzzer-required instrumentation, no linking. |
60 | SANITIZER("fuzzer-no-link", FuzzerNoLink) |
61 | |
62 | // ThreadSanitizer |
63 | SANITIZER("thread", Thread) |
64 | |
65 | // LeakSanitizer |
66 | SANITIZER("leak", Leak) |
67 | |
68 | // UndefinedBehaviorSanitizer |
69 | SANITIZER("alignment", Alignment) |
70 | SANITIZER("array-bounds", ArrayBounds) |
71 | SANITIZER("bool", Bool) |
72 | SANITIZER("builtin", Builtin) |
73 | SANITIZER("enum", Enum) |
74 | SANITIZER("float-cast-overflow", FloatCastOverflow) |
75 | SANITIZER("float-divide-by-zero", FloatDivideByZero) |
76 | SANITIZER("function", Function) |
77 | SANITIZER("integer-divide-by-zero", IntegerDivideByZero) |
78 | SANITIZER("nonnull-attribute", NonnullAttribute) |
79 | SANITIZER("null", Null) |
80 | SANITIZER("nullability-arg", NullabilityArg) |
81 | SANITIZER("nullability-assign", NullabilityAssign) |
82 | SANITIZER("nullability-return", NullabilityReturn) |
83 | SANITIZER_GROUP("nullability", Nullability, |
84 | NullabilityArg | NullabilityAssign | NullabilityReturn) |
85 | SANITIZER("object-size", ObjectSize) |
86 | SANITIZER("pointer-overflow", PointerOverflow) |
87 | SANITIZER("return", Return) |
88 | SANITIZER("returns-nonnull-attribute", ReturnsNonnullAttribute) |
89 | SANITIZER("shift-base", ShiftBase) |
90 | SANITIZER("shift-exponent", ShiftExponent) |
91 | SANITIZER_GROUP("shift", Shift, ShiftBase | ShiftExponent) |
92 | SANITIZER("signed-integer-overflow", SignedIntegerOverflow) |
93 | SANITIZER("unreachable", Unreachable) |
94 | SANITIZER("vla-bound", VLABound) |
95 | SANITIZER("vptr", Vptr) |
96 | |
97 | // IntegerSanitizer |
98 | SANITIZER("unsigned-integer-overflow", UnsignedIntegerOverflow) |
99 | |
100 | // DataFlowSanitizer |
101 | SANITIZER("dataflow", DataFlow) |
102 | |
103 | // Control Flow Integrity |
104 | SANITIZER("cfi-cast-strict", CFICastStrict) |
105 | SANITIZER("cfi-derived-cast", CFIDerivedCast) |
106 | SANITIZER("cfi-icall", CFIICall) |
107 | SANITIZER("cfi-mfcall", CFIMFCall) |
108 | SANITIZER("cfi-unrelated-cast", CFIUnrelatedCast) |
109 | SANITIZER("cfi-nvcall", CFINVCall) |
110 | SANITIZER("cfi-vcall", CFIVCall) |
111 | SANITIZER_GROUP("cfi", CFI, |
112 | CFIDerivedCast | CFIICall | CFIMFCall | CFIUnrelatedCast | |
113 | CFINVCall | CFIVCall) |
114 | |
115 | // Safe Stack |
116 | SANITIZER("safe-stack", SafeStack) |
117 | |
118 | // Shadow Call Stack |
119 | SANITIZER("shadow-call-stack", ShadowCallStack) |
120 | |
121 | // -fsanitize=undefined includes all the sanitizers which have low overhead, no |
122 | // ABI or address space layout implications, and only catch undefined behavior. |
123 | SANITIZER_GROUP("undefined", Undefined, |
124 | Alignment | Bool | Builtin | ArrayBounds | Enum | |
125 | FloatCastOverflow | FloatDivideByZero | |
126 | IntegerDivideByZero | NonnullAttribute | Null | ObjectSize | |
127 | PointerOverflow | Return | ReturnsNonnullAttribute | Shift | |
128 | SignedIntegerOverflow | Unreachable | VLABound | Function | |
129 | Vptr) |
130 | |
131 | // -fsanitize=undefined-trap is an alias for -fsanitize=undefined. |
132 | SANITIZER_GROUP("undefined-trap", UndefinedTrap, Undefined) |
133 | |
134 | // ImplicitConversionSanitizer |
135 | SANITIZER("implicit-integer-truncation", ImplicitIntegerTruncation) |
136 | SANITIZER_GROUP("implicit-conversion", ImplicitConversion, |
137 | ImplicitIntegerTruncation) |
138 | |
139 | SANITIZER_GROUP("integer", Integer, |
140 | ImplicitIntegerTruncation | IntegerDivideByZero | Shift | |
141 | SignedIntegerOverflow | UnsignedIntegerOverflow) |
142 | |
143 | SANITIZER("local-bounds", LocalBounds) |
144 | SANITIZER_GROUP("bounds", Bounds, ArrayBounds | LocalBounds) |
145 | |
146 | // EfficiencySanitizer |
147 | SANITIZER("efficiency-cache-frag", EfficiencyCacheFrag) |
148 | SANITIZER("efficiency-working-set", EfficiencyWorkingSet) |
149 | // Meta-group only used internally. |
150 | SANITIZER_GROUP("efficiency-all", Efficiency, |
151 | EfficiencyCacheFrag | EfficiencyWorkingSet) |
152 | |
153 | // Scudo hardened allocator |
154 | SANITIZER("scudo", Scudo) |
155 | |
156 | // Magic group, containing all sanitizers. For example, "-fno-sanitize=all" |
157 | // can be used to disable all the sanitizers. |
158 | SANITIZER_GROUP("all", All, ~0ULL) |
159 | |
160 | #undef SANITIZER |
161 | #undef SANITIZER_GROUP |
162 |
Warning: That file was not part of the compilation database. It may have many parsing errors.