summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Gousseau <pierregousseau14@gmail.com>2019-09-13 08:22:58 +0000
committerPierre Gousseau <pierregousseau14@gmail.com>2019-09-13 08:22:58 +0000
commitb83f360f7e249afbc59a20dc81845ac776079f0a (patch)
treee020616be9b8595d6b62e5f8fe67548d64f2df9e
parentbc49d718b9851eca202bac795867859647574cc2 (diff)
downloadcompiler-rt-b83f360f7e249afbc59a20dc81845ac776079f0a.tar.gz
[compiler-rt] Add ubsan interface header.
This is to document __ubsan_default_options(). Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D67503 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371822 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/CMakeLists.txt1
-rw-r--r--include/sanitizer/ubsan_interface.h32
2 files changed, 33 insertions, 0 deletions
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index 57ed6c3ad..403ded4ea 100644
--- a/include/CMakeLists.txt
+++ b/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/include/sanitizer/ubsan_interface.h b/include/sanitizer/ubsan_interface.h
new file mode 100644
index 000000000..59fc6c3c1
--- /dev/null
+++ b/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,
+/// <c>verbosity=1:halt_on_error=0</c>).
+///
+/// \returns Default options string.
+const char* __ubsan_default_options(void);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // SANITIZER_UBSAN_INTERFACE_H