[compiler-rt] r342747 - [sanitizer] Move __sanitizer_set_death_callback to a more appropriate file
Kostya Kortchinsky via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 21 10:05:56 PDT 2018
Author: cryptoad
Date: Fri Sep 21 10:05:56 2018
New Revision: 342747
URL: http://llvm.org/viewvc/llvm-project?rev=342747&view=rev
Log:
[sanitizer] Move __sanitizer_set_death_callback to a more appropriate file
Summary:
`__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.
Reviewers: eugenis
Reviewed By: eugenis
Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D52363
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc
compiler-rt/trunk/lib/sanitizer_common/sanitizer_termination.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc?rev=342747&r1=342746&r2=342747&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.cc Fri Sep 21 10:05:56 2018
@@ -339,11 +339,6 @@ int __sanitizer_acquire_crash_state() {
}
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 *)) {
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_termination.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_termination.cc?rev=342747&r1=342746&r2=342747&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_termination.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_termination.cc Fri Sep 21 10:05:56 2018
@@ -84,3 +84,12 @@ void NORETURN CheckFailed(const char *fi
}
} // namespace __sanitizer
+
+using namespace __sanitizer; // NOLINT
+
+extern "C" {
+SANITIZER_INTERFACE_ATTRIBUTE
+void __sanitizer_set_death_callback(void (*callback)(void)) {
+ SetUserDieCallback(callback);
+}
+} // extern "C"
More information about the llvm-commits
mailing list