ubsan_flags.h revision 280031
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#define UBSAN_FLAG(Type, Name, DefaultValue, Description) Type Name; 22#include "ubsan_flags.inc" 23#undef UBSAN_FLAG 24 25 void SetDefaults(); 26}; 27 28extern Flags ubsan_flags; 29inline Flags *flags() { return &ubsan_flags; } 30 31void InitializeFlags(bool standalone); 32 33} // namespace __ubsan 34 35extern "C" { 36// Users may provide their own implementation of __ubsan_default_options to 37// override the default flag values. 38SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE 39const char *__ubsan_default_options(); 40} // extern "C" 41 42#endif // UBSAN_FLAGS_H 43