1 //===-- sanitizer_flags.h ---------------------------------------*- C++ -*-===//
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
6 //===----------------------------------------------------------------------===//
8 // This file is a part of ThreadSanitizer/AddressSanitizer runtime.
10 //===----------------------------------------------------------------------===//
12 #ifndef SANITIZER_FLAGS_H
13 #define SANITIZER_FLAGS_H
15 #include "sanitizer_internal_defs.h"
17 namespace __sanitizer
{
19 enum HandleSignalMode
{
22 kHandleSignalExclusive
,
26 #define COMMON_FLAG(Type, Name, DefaultValue, Description) Type Name;
27 #include "sanitizer_flags.inc"
31 void CopyFrom(const CommonFlags
&other
);
34 // Functions to get/set global CommonFlags shared by all sanitizer runtimes:
35 extern CommonFlags common_flags_dont_use
;
36 inline const CommonFlags
*common_flags() {
37 return &common_flags_dont_use
;
40 inline void SetCommonFlagsDefaults() {
41 common_flags_dont_use
.SetDefaults();
44 // This function can only be used to setup tool-specific overrides for
45 // CommonFlags defaults. Generally, it should only be used right after
46 // SetCommonFlagsDefaults(), but before ParseCommonFlagsFromString(), and
47 // only during the flags initialization (i.e. before they are used for
49 inline void OverrideCommonFlags(const CommonFlags
&cf
) {
50 common_flags_dont_use
.CopyFrom(cf
);
53 void SubstituteForFlagValue(const char *s
, char *out
, uptr out_size
);
56 void RegisterCommonFlags(FlagParser
*parser
,
57 CommonFlags
*cf
= &common_flags_dont_use
);
58 void RegisterIncludeFlags(FlagParser
*parser
, CommonFlags
*cf
);
60 // Should be called after parsing all flags. Sets up common flag values
61 // and perform initializations common to all sanitizers (e.g. setting
63 void InitializeCommonFlags(CommonFlags
*cf
= &common_flags_dont_use
);
64 } // namespace __sanitizer
66 #endif // SANITIZER_FLAGS_H