[PATCH] D52363: [sanitizer] Move __sanitizer_set_death_callback to a more appropriate file
Kostya Kortchinsky via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 21 08:35:03 PDT 2018
cryptoad created this revision.
cryptoad added a reviewer: eugenis.
Herald added subscribers: Sanitizers, delcypher, kubamracek.
`__sanitizer_set_death_callback` is a public interface function wrapping
`SetUserDieCallback`. Said function is defined in `sanitizer_termination.cc`,
which is not included in all the RT. Moving the interface function to that
file allows to not have a spurious public fuinction in RT that don't use it.
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D52363
Files:
lib/sanitizer_common/sanitizer_common.cc
lib/sanitizer_common/sanitizer_termination.cc
Index: lib/sanitizer_common/sanitizer_termination.cc
===================================================================
--- lib/sanitizer_common/sanitizer_termination.cc
+++ lib/sanitizer_common/sanitizer_termination.cc
@@ -84,3 +84,12 @@
}
} // namespace __sanitizer
+
+using namespace __sanitizer; // NOLINT
+
+extern "C" {
+SANITIZER_INTERFACE_ATTRIBUTE
+void __sanitizer_set_death_callback(void (*callback)(void)) {
+ SetUserDieCallback(callback);
+}
+} // extern "C"
Index: lib/sanitizer_common/sanitizer_common.cc
===================================================================
--- lib/sanitizer_common/sanitizer_common.cc
+++ lib/sanitizer_common/sanitizer_common.cc
@@ -339,11 +339,6 @@
}
SANITIZER_INTERFACE_ATTRIBUTE
-void __sanitizer_set_death_callback(void (*callback)(void)) {
- SetUserDieCallback(callback);
-}
-
-SANITIZER_INTERFACE_ATTRIBUTE
int __sanitizer_install_malloc_and_free_hooks(void (*malloc_hook)(const void *,
uptr),
void (*free_hook)(const void *)) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52363.166488.patch
Type: text/x-patch
Size: 1112 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180921/449d8241/attachment.bin>
More information about the llvm-commits
mailing list