ubsan_flags.h revision 276789
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 __ubsan {
19
20struct Flags {
21  bool halt_on_error;
22  bool print_stacktrace;
23};
24
25extern Flags ubsan_flags;
26inline Flags *flags() { return &ubsan_flags; }
27
28void InitializeCommonFlags();
29void InitializeFlags();
30
31}  // namespace __ubsan
32
33extern "C" {
34// Users may provide their own implementation of __ubsan_default_options to
35// override the default flag values.
36SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
37const char *__ubsan_default_options();
38}  // extern "C"
39
40#endif  // UBSAN_FLAGS_H
41