]>
Commit | Line | Data |
---|---|---|
866e32ad KS |
1 | //===-- ubsan_flags.h -------------------------------------------*- C++ -*-===// |
2 | // | |
b667dd70 ML |
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 | |
866e32ad KS |
6 | // |
7 | //===----------------------------------------------------------------------===// | |
8 | // | |
9 | // Runtime flags for UndefinedBehaviorSanitizer. | |
10 | // | |
11 | //===----------------------------------------------------------------------===// | |
12 | #ifndef UBSAN_FLAGS_H | |
13 | #define UBSAN_FLAGS_H | |
14 | ||
15 | #include "sanitizer_common/sanitizer_internal_defs.h" | |
16 | ||
696d846a MO |
17 | namespace __sanitizer { |
18 | class FlagParser; | |
19 | } | |
20 | ||
866e32ad KS |
21 | namespace __ubsan { |
22 | ||
23 | struct Flags { | |
696d846a MO |
24 | #define UBSAN_FLAG(Type, Name, DefaultValue, Description) Type Name; |
25 | #include "ubsan_flags.inc" | |
26 | #undef UBSAN_FLAG | |
27 | ||
28 | void SetDefaults(); | |
866e32ad KS |
29 | }; |
30 | ||
31 | extern Flags ubsan_flags; | |
32 | inline Flags *flags() { return &ubsan_flags; } | |
33 | ||
866e32ad | 34 | void InitializeFlags(); |
696d846a MO |
35 | void RegisterUbsanFlags(FlagParser *parser, Flags *f); |
36 | ||
37 | const char *MaybeCallUbsanDefaultOptions(); | |
866e32ad KS |
38 | |
39 | } // namespace __ubsan | |
40 | ||
41 | extern "C" { | |
42 | // Users may provide their own implementation of __ubsan_default_options to | |
43 | // override the default flag values. | |
44 | SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE | |
45 | const char *__ubsan_default_options(); | |
46 | } // extern "C" | |
47 | ||
48 | #endif // UBSAN_FLAGS_H |