xref: /netbsd-src/external/gpl3/gcc.old/dist/libsanitizer/asan/asan_flags.h (revision 1debfc3d3fad8af6f31804271c18e67f77b4d718)
1 //===-- asan_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 // This file is a part of AddressSanitizer, an address sanity checker.
9 //
10 // ASan runtime flags.
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef ASAN_FLAGS_H
14 #define ASAN_FLAGS_H
15 
16 #include "sanitizer_common/sanitizer_internal_defs.h"
17 #include "sanitizer_common/sanitizer_flag_parser.h"
18 
19 // ASan flag values can be defined in four ways:
20 // 1) initialized with default values at startup.
21 // 2) overriden during compilation of ASan runtime by providing
22 //    compile definition ASAN_DEFAULT_OPTIONS.
23 // 3) overriden from string returned by user-specified function
24 //    __asan_default_options().
25 // 4) overriden from env variable ASAN_OPTIONS.
26 // 5) overriden during ASan activation (for now used on Android only).
27 
28 namespace __asan {
29 
30 struct Flags {
31 #define ASAN_FLAG(Type, Name, DefaultValue, Description) Type Name;
32 #include "asan_flags.inc"
33 #undef ASAN_FLAG
34 
35   void SetDefaults();
36 };
37 
38 extern Flags asan_flags_dont_use_directly;
flags()39 inline Flags *flags() {
40   return &asan_flags_dont_use_directly;
41 }
42 
43 void InitializeFlags();
44 
45 }  // namespace __asan
46 
47 #endif  // ASAN_FLAGS_H
48