From 1ae9e6918d94ec0e296c7753cd3f1a7c22cb3153 Mon Sep 17 00:00:00 2001 From: Pierre Gousseau Date: Fri, 13 Sep 2019 08:22:58 +0000 Subject: [PATCH] [compiler-rt] Add ubsan interface header. This is to document __ubsan_default_options(). Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D67503 llvm-svn: 371822 --- compiler-rt/include/CMakeLists.txt | 1 + compiler-rt/include/sanitizer/ubsan_interface.h | 32 +++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 compiler-rt/include/sanitizer/ubsan_interface.h diff --git a/compiler-rt/include/CMakeLists.txt b/compiler-rt/include/CMakeLists.txt index 57ed6c3..403ded4 100644 --- a/compiler-rt/include/CMakeLists.txt +++ b/compiler-rt/include/CMakeLists.txt @@ -13,6 +13,7 @@ if (COMPILER_RT_BUILD_SANITIZERS) sanitizer/scudo_interface.h sanitizer/tsan_interface.h sanitizer/tsan_interface_atomic.h + sanitizer/ubsan_interface.h ) set(FUZZER_HEADERS fuzzer/FuzzedDataProvider.h diff --git a/compiler-rt/include/sanitizer/ubsan_interface.h b/compiler-rt/include/sanitizer/ubsan_interface.h new file mode 100644 index 0000000..59fc6c3 --- /dev/null +++ b/compiler-rt/include/sanitizer/ubsan_interface.h @@ -0,0 +1,32 @@ +//===-- sanitizer/ubsan_interface.h -----------------------------*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// This file is a part of UBSanitizer (UBSan). +// +// Public interface header. +//===----------------------------------------------------------------------===// +#ifndef SANITIZER_UBSAN_INTERFACE_H +#define SANITIZER_UBSAN_INTERFACE_H + +#ifdef __cplusplus +extern "C" { +#endif +/// User-provided default option settings. +/// +/// You can provide your own implementation of this function to return a string +/// containing UBSan runtime options (for example, +/// verbosity=1:halt_on_error=0). +/// +/// \returns Default options string. +const char* __ubsan_default_options(void); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // SANITIZER_UBSAN_INTERFACE_H -- 2.7.4