|
| 1 | +//===-- SanitizerHandler.h - Definition of sanitizer handlers ---*- C++ -*-===// |
| 2 | +// |
| 3 | +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | +// See https://llvm.org/LICENSE.txt for license information. |
| 5 | +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | +// |
| 7 | +//===----------------------------------------------------------------------===// |
| 8 | +// |
| 9 | +// This is the internal per-function state used for llvm translation. |
| 10 | +// |
| 11 | +//===----------------------------------------------------------------------===// |
| 12 | + |
| 13 | +#ifndef LLVM_CLANG_LIB_CODEGEN_SANITIZER_HANDLER_H |
| 14 | +#define LLVM_CLANG_LIB_CODEGEN_SANITIZER_HANDLER_H |
| 15 | + |
| 16 | +#define LIST_SANITIZER_CHECKS \ |
| 17 | + SANITIZER_CHECK(AddOverflow, add_overflow, 0) \ |
| 18 | + SANITIZER_CHECK(BuiltinUnreachable, builtin_unreachable, 0) \ |
| 19 | + SANITIZER_CHECK(CFICheckFail, cfi_check_fail, 0) \ |
| 20 | + SANITIZER_CHECK(DivremOverflow, divrem_overflow, 0) \ |
| 21 | + SANITIZER_CHECK(DynamicTypeCacheMiss, dynamic_type_cache_miss, 0) \ |
| 22 | + SANITIZER_CHECK(FloatCastOverflow, float_cast_overflow, 0) \ |
| 23 | + SANITIZER_CHECK(FunctionTypeMismatch, function_type_mismatch, 0) \ |
| 24 | + SANITIZER_CHECK(ImplicitConversion, implicit_conversion, 0) \ |
| 25 | + SANITIZER_CHECK(InvalidBuiltin, invalid_builtin, 0) \ |
| 26 | + SANITIZER_CHECK(InvalidObjCCast, invalid_objc_cast, 0) \ |
| 27 | + SANITIZER_CHECK(LoadInvalidValue, load_invalid_value, 0) \ |
| 28 | + SANITIZER_CHECK(MissingReturn, missing_return, 0) \ |
| 29 | + SANITIZER_CHECK(MulOverflow, mul_overflow, 0) \ |
| 30 | + SANITIZER_CHECK(NegateOverflow, negate_overflow, 0) \ |
| 31 | + SANITIZER_CHECK(NullabilityArg, nullability_arg, 0) \ |
| 32 | + SANITIZER_CHECK(NullabilityReturn, nullability_return, 1) \ |
| 33 | + SANITIZER_CHECK(NonnullArg, nonnull_arg, 0) \ |
| 34 | + SANITIZER_CHECK(NonnullReturn, nonnull_return, 1) \ |
| 35 | + SANITIZER_CHECK(OutOfBounds, out_of_bounds, 0) \ |
| 36 | + SANITIZER_CHECK(PointerOverflow, pointer_overflow, 0) \ |
| 37 | + SANITIZER_CHECK(ShiftOutOfBounds, shift_out_of_bounds, 0) \ |
| 38 | + SANITIZER_CHECK(SubOverflow, sub_overflow, 0) \ |
| 39 | + SANITIZER_CHECK(TypeMismatch, type_mismatch, 1) \ |
| 40 | + SANITIZER_CHECK(AlignmentAssumption, alignment_assumption, 0) \ |
| 41 | + SANITIZER_CHECK(VLABoundNotPositive, vla_bound_not_positive, 0) \ |
| 42 | + SANITIZER_CHECK(BoundsSafety, bounds_safety, 0) |
| 43 | + |
| 44 | +enum SanitizerHandler { |
| 45 | +#define SANITIZER_CHECK(Enum, Name, Version) Enum, |
| 46 | + LIST_SANITIZER_CHECKS |
| 47 | +#undef SANITIZER_CHECK |
| 48 | +}; |
| 49 | + |
| 50 | +#endif // LLVM_CLANG_LIB_CODEGEN_SANITIZER_HANDLER_H |
0 commit comments