Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/clang/include/clang/Basic/Sanitizers.def
Line
Count
Source
1
472k
//===--- Sanitizers.def - Runtime sanitizer options -------------*- C++ -*-===//
2
472k
//
3
472k
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
472k
// See https://llvm.org/LICENSE.txt for license information.
5
472k
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
472k
//
7
472k
//===----------------------------------------------------------------------===//
8
472k
//
9
472k
// This file defines the options for specifying which runtime sanitizers to
10
472k
// enable. Users of this file must define the SANITIZER macro to make use of
11
472k
// this information. Users of this file can also define the SANITIZER_GROUP
12
472k
// macro to get information on options which refer to sets of sanitizers.
13
472k
//
14
472k
//===----------------------------------------------------------------------===//
15
472k
16
#ifndef SANITIZER
17
#error "Define SANITIZER prior to including this file!"
18
#endif
19
20
472k
// SANITIZER(NAME, ID)
21
472k
22
472k
// The first value is the name of the sanitizer as a string. The sanitizer can
23
472k
// be enabled by specifying -fsanitize=NAME.
24
472k
25
472k
// The second value is an identifier which can be used to refer to the
26
472k
// sanitizer.
27
472k
28
472k
29
472k
// SANITIZER_GROUP(NAME, ID, ALIAS)
30
472k
31
472k
// The first two values have the same semantics as the corresponding SANITIZER
32
472k
// values. The third value is an expression ORing together the IDs of individual
33
472k
// sanitizers in this group.
34
472k
35
#ifndef SANITIZER_GROUP
36
#define SANITIZER_GROUP(NAME, ID, ALIAS)
37
#endif
38
39
472k
40
472k
// AddressSanitizer
41
472k
SANITIZER405k
("address", Address)
42
3.10k
43
3.10k
// Requires AddressSanitizer
44
22.2k
SANITIZER("pointer-compare", PointerCompare)
45
3.08k
46
3.08k
// Requires AddressSanitizer
47
22.2k
SANITIZER("pointer-subtract", PointerSubtract)
48
3.08k
49
3.08k
// Kernel AddressSanitizer (KASan)
50
22.2k
SANITIZER("kernel-address", KernelAddress)
51
3.08k
52
3.08k
// Hardware-assisted AddressSanitizer
53
22.2k
SANITIZER("hwaddress", HWAddress)
54
3.08k
55
3.08k
// Kernel Hardware-assisted AddressSanitizer (KHWASan)
56
22.2k
SANITIZER("kernel-hwaddress", KernelHWAddress)
57
3.08k
58
3.08k
// A variant of AddressSanitizer using AArch64 MTE extension.
59
22.2k
SANITIZER("memtag", MemTag)
60
3.08k
61
3.08k
// MemorySanitizer
62
22.2k
SANITIZER("memory", Memory)
63
3.08k
64
3.08k
// Kernel MemorySanitizer (KMSAN)
65
22.2k
SANITIZER("kernel-memory", KernelMemory)
66
3.08k
67
3.08k
// libFuzzer
68
22.2k
SANITIZER("fuzzer", Fuzzer)
69
3.08k
70
3.08k
// libFuzzer-required instrumentation, no linking.
71
22.2k
SANITIZER("fuzzer-no-link", FuzzerNoLink)
72
3.08k
73
3.08k
// ThreadSanitizer
74
22.2k
SANITIZER("thread", Thread)
75
3.08k
76
3.08k
// LeakSanitizer
77
22.2k
SANITIZER("leak", Leak)
78
3.07k
79
3.07k
// UndefinedBehaviorSanitizer
80
22.2k
SANITIZER("alignment", Alignment)
81
22.2k
SANITIZER("array-bounds", ArrayBounds)
82
22.2k
SANITIZER("bool", Bool)
83
22.2k
SANITIZER("builtin", Builtin)
84
22.2k
SANITIZER("enum", Enum)
85
22.2k
SANITIZER("float-cast-overflow", FloatCastOverflow)
86
22.2k
SANITIZER("float-divide-by-zero", FloatDivideByZero)
87
22.2k
SANITIZER("function", Function)
88
22.2k
SANITIZER("integer-divide-by-zero", IntegerDivideByZero)
89
22.2k
SANITIZER("nonnull-attribute", NonnullAttribute)
90
22.2k
SANITIZER("null", Null)
91
22.2k
SANITIZER("nullability-arg", NullabilityArg)
92
22.2k
SANITIZER("nullability-assign", NullabilityAssign)
93
22.2k
SANITIZER("nullability-return", NullabilityReturn)
94
76.7k
SANITIZER_GROUP("nullability", Nullability,
95
3.07k
                NullabilityArg | NullabilityAssign | NullabilityReturn)
96
22.2k
SANITIZER("object-size", ObjectSize)
97
22.2k
SANITIZER("pointer-overflow", PointerOverflow)
98
22.2k
SANITIZER("return", Return)
99
22.2k
SANITIZER("returns-nonnull-attribute", ReturnsNonnullAttribute)
100
22.2k
SANITIZER("shift-base", ShiftBase)
101
22.2k
SANITIZER("shift-exponent", ShiftExponent)
102
76.7k
SANITIZER_GROUP("shift", Shift, ShiftBase | ShiftExponent)
103
22.2k
SANITIZER("signed-integer-overflow", SignedIntegerOverflow)
104
22.2k
SANITIZER("unreachable", Unreachable)
105
22.2k
SANITIZER("vla-bound", VLABound)
106
22.2k
SANITIZER("vptr", Vptr)
107
3.07k
108
3.07k
// IntegerSanitizer
109
22.2k
SANITIZER("unsigned-integer-overflow", UnsignedIntegerOverflow)
110
3.07k
111
3.07k
// DataFlowSanitizer
112
22.2k
SANITIZER("dataflow", DataFlow)
113
3.07k
114
3.07k
// Control Flow Integrity
115
22.1k
SANITIZER("cfi-cast-strict", CFICastStrict)
116
22.1k
SANITIZER("cfi-derived-cast", CFIDerivedCast)
117
22.1k
SANITIZER("cfi-icall", CFIICall)
118
22.1k
SANITIZER("cfi-mfcall", CFIMFCall)
119
22.1k
SANITIZER("cfi-unrelated-cast", CFIUnrelatedCast)
120
22.1k
SANITIZER("cfi-nvcall", CFINVCall)
121
22.1k
SANITIZER("cfi-vcall", CFIVCall)
122
76.7k
SANITIZER_GROUP("cfi", CFI,
123
3.07k
                CFIDerivedCast | CFIICall | CFIMFCall | CFIUnrelatedCast |
124
3.07k
                    CFINVCall | CFIVCall)
125
3.07k
126
3.07k
// Safe Stack
127
22.1k
SANITIZER("safe-stack", SafeStack)
128
3.07k
129
3.07k
// Shadow Call Stack
130
22.1k
SANITIZER("shadow-call-stack", ShadowCallStack)
131
3.07k
132
3.07k
// -fsanitize=undefined includes all the sanitizers which have low overhead, no
133
3.07k
// ABI or address space layout implications, and only catch undefined behavior.
134
76.7k
SANITIZER_GROUP("undefined", Undefined,
135
3.07k
                Alignment | Bool | Builtin | ArrayBounds | Enum |
136
3.07k
                    FloatCastOverflow |
137
3.07k
                    IntegerDivideByZero | NonnullAttribute | Null | ObjectSize |
138
3.07k
                    PointerOverflow | Return | ReturnsNonnullAttribute | Shift |
139
3.07k
                    SignedIntegerOverflow | Unreachable | VLABound | Function |
140
3.07k
                    Vptr)
141
3.07k
142
3.07k
// -fsanitize=undefined-trap is an alias for -fsanitize=undefined.
143
76.7k
SANITIZER_GROUP("undefined-trap", UndefinedTrap, Undefined)
144
3.07k
145
3.07k
// ImplicitConversionSanitizer
146
22.1k
SANITIZER("implicit-unsigned-integer-truncation",
147
3.07k
          ImplicitUnsignedIntegerTruncation)
148
22.1k
SANITIZER("implicit-signed-integer-truncation", ImplicitSignedIntegerTruncation)
149
76.7k
SANITIZER_GROUP("implicit-integer-truncation", ImplicitIntegerTruncation,
150
3.07k
                ImplicitUnsignedIntegerTruncation |
151
3.07k
                    ImplicitSignedIntegerTruncation)
152
3.07k
153
22.1k
SANITIZER("implicit-integer-sign-change", ImplicitIntegerSignChange)
154
3.07k
155
76.7k
SANITIZER_GROUP("implicit-integer-arithmetic-value-change",
156
3.07k
                ImplicitIntegerArithmeticValueChange,
157
3.07k
                ImplicitIntegerSignChange | ImplicitSignedIntegerTruncation)
158
3.07k
159
3.07k
// FIXME:
160
3.07k
//SANITIZER_GROUP("implicit-integer-conversion", ImplicitIntegerConversion,
161
3.07k
//                ImplicitIntegerArithmeticValueChange |
162
3.07k
//                    ImplicitUnsignedIntegerTruncation)
163
3.07k
//SANITIZER_GROUP("implicit-conversion", ImplicitConversion,
164
3.07k
//                ImplicitIntegerConversion)
165
3.07k
166
76.7k
SANITIZER_GROUP("implicit-conversion", ImplicitConversion,
167
3.07k
                ImplicitIntegerArithmeticValueChange |
168
3.07k
                    ImplicitUnsignedIntegerTruncation)
169
3.07k
170
76.7k
SANITIZER_GROUP("integer", Integer,
171
3.07k
                ImplicitConversion | IntegerDivideByZero | Shift |
172
3.07k
                    SignedIntegerOverflow | UnsignedIntegerOverflow)
173
3.07k
174
22.1k
SANITIZER("local-bounds", LocalBounds)
175
76.7k
SANITIZER_GROUP("bounds", Bounds, ArrayBounds | LocalBounds)
176
3.07k
177
3.07k
// Scudo hardened allocator
178
405k
SANITIZER("scudo", Scudo)
179
3.07k
180
3.07k
// Magic group, containing all sanitizers. For example, "-fno-sanitize=all"
181
3.07k
// can be used to disable all the sanitizers.
182
76.7k
SANITIZER_GROUP("all", All, ~SanitizerMask())
183
3.07k
184
3.07k
#undef SANITIZER
185
3.07k
#undef SANITIZER_GROUP