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