1167598Srrs//===-- ubsan_flags.h -------------------------------------------*- C++ -*-===// 2169382Srrs// 3235828Stuexen// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4235828Stuexen// See https://llvm.org/LICENSE.txt for license information. 5167598Srrs// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6167598Srrs// 7167598Srrs//===----------------------------------------------------------------------===// 8167598Srrs// 9167598Srrs// Runtime flags for UndefinedBehaviorSanitizer. 10228653Stuexen// 11167598Srrs//===----------------------------------------------------------------------===// 12167598Srrs#ifndef UBSAN_FLAGS_H 13167598Srrs#define UBSAN_FLAGS_H 14228653Stuexen 15167598Srrs#include "sanitizer_common/sanitizer_internal_defs.h" 16167598Srrs 17167598Srrsnamespace __sanitizer { 18167598Srrsclass FlagParser; 19167598Srrs} 20167598Srrs 21167598Srrsnamespace __ubsan { 22167598Srrs 23167598Srrsstruct Flags { 24167598Srrs#define UBSAN_FLAG(Type, Name, DefaultValue, Description) Type Name; 25167598Srrs#include "ubsan_flags.inc" 26167598Srrs#undef UBSAN_FLAG 27167598Srrs 28167598Srrs void SetDefaults(); 29167598Srrs}; 30167598Srrs 31167598Srrsextern Flags ubsan_flags; 32167598Srrsinline Flags *flags() { return &ubsan_flags; } 33167598Srrs 34167598Srrsvoid InitializeFlags(); 35167598Srrsvoid RegisterUbsanFlags(FlagParser *parser, Flags *f); 36167598Srrs 37179783Srrsconst char *MaybeCallUbsanDefaultOptions(); 38167598Srrs 39167598Srrs} // namespace __ubsan 40167598Srrs 41167598Srrsextern "C" { 42170056Srrs// Users may provide their own implementation of __ubsan_default_options to 43205629Srrs// override the default flag values. 44270673StuexenSANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE 45179783Srrsconst char *__ubsan_default_options(); 46270673Stuexen} // extern "C" 47270673Stuexen 48167598Srrs#endif // UBSAN_FLAGS_H 49167598Srrs