]> git.ipfire.org Git - thirdparty/gcc.git/blame - libsanitizer/sanitizer_common/sanitizer_flags.h
Remove support for alternative Solaris 11.4 ld -V output
[thirdparty/gcc.git] / libsanitizer / sanitizer_common / sanitizer_flags.h
CommitLineData
549e2197 1//===-- sanitizer_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 ThreadSanitizer/AddressSanitizer runtime.
9//
10//===----------------------------------------------------------------------===//
11
12#ifndef SANITIZER_FLAGS_H
13#define SANITIZER_FLAGS_H
14
15#include "sanitizer_internal_defs.h"
16
17namespace __sanitizer {
18
36093749 19enum HandleSignalMode {
20 kHandleSignalNo,
21 kHandleSignalYes,
22 kHandleSignalExclusive,
23};
24
1e80ce41 25struct CommonFlags {
5645a48f 26#define COMMON_FLAG(Type, Name, DefaultValue, Description) Type Name;
27#include "sanitizer_flags.inc"
28#undef COMMON_FLAG
29
30 void SetDefaults();
31 void CopyFrom(const CommonFlags &other);
1e80ce41 32};
33
5645a48f 34// Functions to get/set global CommonFlags shared by all sanitizer runtimes:
35extern CommonFlags common_flags_dont_use;
36inline const CommonFlags *common_flags() {
7d752f28 37 return &common_flags_dont_use;
1e80ce41 38}
39
5645a48f 40inline void SetCommonFlagsDefaults() {
41 common_flags_dont_use.SetDefaults();
42}
43
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
48// the first time).
49inline void OverrideCommonFlags(const CommonFlags &cf) {
50 common_flags_dont_use.CopyFrom(cf);
51}
1e80ce41 52
23e39437 53void SubstituteForFlagValue(const char *s, char *out, uptr out_size);
54
5645a48f 55class FlagParser;
56void RegisterCommonFlags(FlagParser *parser,
57 CommonFlags *cf = &common_flags_dont_use);
58void RegisterIncludeFlags(FlagParser *parser, CommonFlags *cf);
23e39437 59
60// Should be called after parsing all flags. Sets up common flag values
61// and perform initializations common to all sanitizers (e.g. setting
62// verbosity).
63void InitializeCommonFlags(CommonFlags *cf = &common_flags_dont_use);
549e2197 64} // namespace __sanitizer
65
66#endif // SANITIZER_FLAGS_H