• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===-- ubsan_flags.h -------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // Runtime flags for UndefinedBehaviorSanitizer.
11 //
12 //===----------------------------------------------------------------------===//
13 #ifndef UBSAN_FLAGS_H
14 #define UBSAN_FLAGS_H
15 
16 #include "sanitizer_common/sanitizer_internal_defs.h"
17 
18 namespace __sanitizer {
19 class FlagParser;
20 }
21 
22 namespace __ubsan {
23 
24 struct Flags {
25 #define UBSAN_FLAG(Type, Name, DefaultValue, Description) Type Name;
26 #include "ubsan_flags.inc"
27 #undef UBSAN_FLAG
28 
29   void SetDefaults();
30 };
31 
32 extern Flags ubsan_flags;
flags()33 inline Flags *flags() { return &ubsan_flags; }
34 
35 void InitializeFlags();
36 void RegisterUbsanFlags(FlagParser *parser, Flags *f);
37 
38 const char *MaybeCallUbsanDefaultOptions();
39 
40 }  // namespace __ubsan
41 
42 extern "C" {
43 // Users may provide their own implementation of __ubsan_default_options to
44 // override the default flag values.
45 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
46 const char *__ubsan_default_options();
47 }  // extern "C"
48 
49 #endif  // UBSAN_FLAGS_H
50