Sanitizers.def revision 243791
1119418Sobrien//===--- Sanitizers.def - Runtime sanitizer options -------------*- C++ -*-===//
291396Stmm//
3178589Smarius//                     The LLVM Compiler Infrastructure
491396Stmm//
591396Stmm// This file is distributed under the University of Illinois Open Source
691396Stmm// License. See LICENSE.TXT for details.
791396Stmm//
891396Stmm//===----------------------------------------------------------------------===//
991396Stmm//
1091396Stmm// This file defines the options for specifying which runtime sanitizers to
1191396Stmm// enable. Users of this file must define the SANITIZER macro to make use of
1291396Stmm// this information. Users of this file can also define the SANITIZER_GROUP
1391396Stmm// macro to get information on options which refer to sets of sanitizers.
1491396Stmm//
1591396Stmm//===----------------------------------------------------------------------===//
1691396Stmm
1791396Stmm#ifndef SANITIZER
1891396Stmm#error "Define SANITIZER prior to including this file!"
1991396Stmm#endif
2091396Stmm
2191396Stmm// SANITIZER(NAME, ID)
2291396Stmm
2391396Stmm// The first value is the name of the sanitizer as a string. The sanitizer can
2491396Stmm// be enabled by specifying -fsanitize=NAME.
2591396Stmm
2691396Stmm// The second value is an identifier which can be used to refer to the
2791396Stmm// sanitizer.
2891396Stmm
29133731Smarius
3091396Stmm// SANITIZER_GROUP(NAME, ID, ALIAS)
3191396Stmm
32119418Sobrien// The first two values have the same semantics as the corresponding SANITIZER
33119418Sobrien// values. The third value is an expression ORing together the IDs of individual
34119418Sobrien// sanitizers in this group.
3591396Stmm
3691396Stmm#ifndef SANITIZER_GROUP
3791396Stmm#define SANITIZER_GROUP(NAME, ID, ALIAS)
3891396Stmm#endif
3991396Stmm
4091396Stmm
4191396Stmm// AddressSanitizer
4291396StmmSANITIZER("address", Address)
43257176Sglebius
44257176Sglebius// ThreadSanitizer
45130026SphkSANITIZER("thread", Thread)
46257176Sglebius
4791396Stmm// UndefinedBehaviorSanitizer
4891396StmmSANITIZER("signed-integer-overflow", SignedIntegerOverflow)
4991396StmmSANITIZER("divide-by-zero", DivideByZero)
5091396StmmSANITIZER("shift", Shift)
51133731SmariusSANITIZER("unreachable", Unreachable)
52119696SmarcelSANITIZER("return", Return)
5391396StmmSANITIZER("vla-bound", VLABound)
54133731SmariusSANITIZER("alignment", Alignment)
5591396StmmSANITIZER("null", Null)
5691396StmmSANITIZER("vptr", Vptr)
5791396StmmSANITIZER("object-size", ObjectSize)
5891396StmmSANITIZER("float-cast-overflow", FloatCastOverflow)
5991396Stmm
6091396Stmm// -fsanitize=undefined (and its alias -fcatch-undefined-behavior). This should
6191396Stmm// include all the sanitizers which have low overhead, no ABI or address space
6291396Stmm// layout implications, and only catch undefined behavior.
6391396StmmSANITIZER_GROUP("undefined", Undefined,
6491396Stmm                SignedIntegerOverflow | DivideByZero | Shift | Unreachable |
65119351Smarcel                Return | VLABound | Alignment | Null | Vptr | ObjectSize |
66119351Smarcel                FloatCastOverflow)
6791396Stmm
68119280Simp#undef SANITIZER
69119280Simp#undef SANITIZER_GROUP
7091396Stmm