]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/compiler-rt/lib/asan/asan_flags.h
Update compiler-rt to trunk r224034. This brings a number of new
[FreeBSD/FreeBSD.git] / contrib / compiler-rt / lib / asan / asan_flags.h
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
20 // ASan flag values can be defined in four ways:
21 // 1) initialized with default values at startup.
22 // 2) overriden during compilation of ASan runtime by providing
23 //    compile definition ASAN_DEFAULT_OPTIONS.
24 // 3) overriden from string returned by user-specified function
25 //    __asan_default_options().
26 // 4) overriden from env variable ASAN_OPTIONS.
27
28 namespace __asan {
29
30 struct Flags {
31   // Flag descriptions are in asan_rtl.cc.
32   int  quarantine_size;
33   int  redzone;
34   int  max_redzone;
35   bool debug;
36   int  report_globals;
37   bool check_initialization_order;
38   bool replace_str;
39   bool replace_intrin;
40   bool mac_ignore_invalid_free;
41   bool detect_stack_use_after_return;
42   int min_uar_stack_size_log;
43   int max_uar_stack_size_log;
44   bool uar_noreserve;
45   int max_malloc_fill_size, malloc_fill_byte;
46   int  exitcode;
47   bool allow_user_poisoning;
48   int  sleep_before_dying;
49   bool check_malloc_usable_size;
50   bool unmap_shadow_on_exit;
51   bool abort_on_error;
52   bool print_stats;
53   bool print_legend;
54   bool atexit;
55   bool allow_reexec;
56   bool print_full_thread_history;
57   bool poison_heap;
58   bool poison_partial;
59   bool poison_array_cookie;
60   bool alloc_dealloc_mismatch;
61   bool new_delete_type_mismatch;
62   bool strict_memcmp;
63   bool strict_init_order;
64   bool start_deactivated;
65   int detect_invalid_pointer_pairs;
66   bool detect_container_overflow;
67   int detect_odr_violation;
68   bool dump_instruction_bytes;
69 };
70
71 extern Flags asan_flags_dont_use_directly;
72 inline Flags *flags() {
73   return &asan_flags_dont_use_directly;
74 }
75 void InitializeFlags(Flags *f, const char *env);
76
77 }  // namespace __asan
78
79 #endif  // ASAN_FLAGS_H