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