PR rtl-optimization/79386
[official-gcc.git] / libsanitizer / ubsan / ubsan_flags.h
blob2604b6b00ccd49dad13b00d6c0bac3baa2392cd3
1 //===-- ubsan_flags.h -------------------------------------------*- C++ -*-===//
2 //
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
5 //
6 //===----------------------------------------------------------------------===//
7 //
8 // Runtime flags for UndefinedBehaviorSanitizer.
9 //
10 //===----------------------------------------------------------------------===//
11 #ifndef UBSAN_FLAGS_H
12 #define UBSAN_FLAGS_H
14 #include "sanitizer_common/sanitizer_internal_defs.h"
16 namespace __sanitizer {
17 class FlagParser;
20 namespace __ubsan {
22 struct Flags {
23 #define UBSAN_FLAG(Type, Name, DefaultValue, Description) Type Name;
24 #include "ubsan_flags.inc"
25 #undef UBSAN_FLAG
27 void SetDefaults();
30 extern Flags ubsan_flags;
31 inline Flags *flags() { return &ubsan_flags; }
33 void InitializeFlags();
34 void RegisterUbsanFlags(FlagParser *parser, Flags *f);
36 const char *MaybeCallUbsanDefaultOptions();
38 } // namespace __ubsan
40 extern "C" {
41 // Users may provide their own implementation of __ubsan_default_options to
42 // override the default flag values.
43 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
44 const char *__ubsan_default_options();
45 } // extern "C"
47 #endif // UBSAN_FLAGS_H