ubsan_flags.h revision 288943
1//===-- ubsan_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// Runtime flags for UndefinedBehaviorSanitizer.
11//
12//===----------------------------------------------------------------------===//
13#ifndef UBSAN_FLAGS_H
14#define UBSAN_FLAGS_H
15
16#include "sanitizer_common/sanitizer_internal_defs.h"
17
18namespace __sanitizer {
19class FlagParser;
20}
21
22namespace __ubsan {
23
24struct Flags {
25#define UBSAN_FLAG(Type, Name, DefaultValue, Description) Type Name;
26#include "ubsan_flags.inc"
27#undef UBSAN_FLAG
28
29  void SetDefaults();
30};
31
32extern Flags ubsan_flags;
33inline Flags *flags() { return &ubsan_flags; }
34
35void InitializeFlags();
36void RegisterUbsanFlags(FlagParser *parser, Flags *f);
37
38const char *MaybeCallUbsanDefaultOptions();
39
40}  // namespace __ubsan
41
42extern "C" {
43// Users may provide their own implementation of __ubsan_default_options to
44// override the default flag values.
45SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
46const char *__ubsan_default_options();
47}  // extern "C"
48
49#endif  // UBSAN_FLAGS_H
50