[compiler-rt] c975385 - [TySan] Add skeleton for adding interface functions (#170859)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 10 02:48:50 PST 2026
Author: Matthew Nagy
Date: 2026-02-10T10:48:46Z
New Revision: c9753859d19b07315c5a9a493efaa4df18db84ab
URL: https://github.com/llvm/llvm-project/commit/c9753859d19b07315c5a9a493efaa4df18db84ab
DIFF: https://github.com/llvm/llvm-project/commit/c9753859d19b07315c5a9a493efaa4df18db84ab.diff
LOG: [TySan] Add skeleton for adding interface functions (#170859)
This pr has the more straightforward changes from the initial interfaces
pr (https://github.com/llvm/llvm-project/pull/169023). By supporting
interfaces, it also will help me fix [this
issue](https://github.com/llvm/llvm-project/issues/169024) where we
don't test tysan with the sanitizer_common codebase
Added:
compiler-rt/include/sanitizer/tysan_interface.h
Modified:
compiler-rt/include/CMakeLists.txt
compiler-rt/lib/sanitizer_common/tests/sanitizer_common_test.cpp
llvm/utils/gn/secondary/compiler-rt/include/BUILD.gn
Removed:
################################################################################
diff --git a/compiler-rt/include/CMakeLists.txt b/compiler-rt/include/CMakeLists.txt
index 242d62b9b447b..8443e309d1e95 100644
--- a/compiler-rt/include/CMakeLists.txt
+++ b/compiler-rt/include/CMakeLists.txt
@@ -14,6 +14,7 @@ if (COMPILER_RT_BUILD_SANITIZERS)
sanitizer/scudo_interface.h
sanitizer/tsan_interface.h
sanitizer/tsan_interface_atomic.h
+ sanitizer/tysan_interface.h
sanitizer/ubsan_interface.h
)
set(FUZZER_HEADERS
diff --git a/compiler-rt/include/sanitizer/tysan_interface.h b/compiler-rt/include/sanitizer/tysan_interface.h
new file mode 100644
index 0000000000000..0a84f445bc8f6
--- /dev/null
+++ b/compiler-rt/include/sanitizer/tysan_interface.h
@@ -0,0 +1,29 @@
+//===-- tysan_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 TypeSanitizer.
+//
+// Public interface header for TySan.
+//===----------------------------------------------------------------------===//
+#ifndef SANITIZER_TYSAN_INTERFACE_H
+#define SANITIZER_TYSAN_INTERFACE_H
+
+#include <sanitizer/common_interface_defs.h>
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// No interfaces currently
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_common_test.cpp b/compiler-rt/lib/sanitizer_common/tests/sanitizer_common_test.cpp
index 111e55ef36bfb..917ba847ad478 100644
--- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_common_test.cpp
+++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_common_test.cpp
@@ -21,6 +21,7 @@
#include "../../../include/sanitizer/asan_interface.h"
#include "../../../include/sanitizer/msan_interface.h"
#include "../../../include/sanitizer/tsan_interface.h"
+#include "../../../include/sanitizer/tysan_interface.h"
#include "gtest/gtest.h"
#include "sanitizer_common/sanitizer_allocator_internal.h"
#include "sanitizer_common/sanitizer_common.h"
diff --git a/llvm/utils/gn/secondary/compiler-rt/include/BUILD.gn b/llvm/utils/gn/secondary/compiler-rt/include/BUILD.gn
index 273fd7172da62..3992cd726c750 100644
--- a/llvm/utils/gn/secondary/compiler-rt/include/BUILD.gn
+++ b/llvm/utils/gn/secondary/compiler-rt/include/BUILD.gn
@@ -22,6 +22,7 @@ copy("include") {
"sanitizer/scudo_interface.h",
"sanitizer/tsan_interface.h",
"sanitizer/tsan_interface_atomic.h",
+ "sanitizer/tysan_interface.h",
"sanitizer/ubsan_interface.h",
]
outputs = [ "$clang_resource_dir/include/{{source_target_relative}}" ]
More information about the llvm-commits
mailing list