diff options
author | Kostya Kortchinsky <kostyak@google.com> | 2018-09-21 17:05:56 +0000 |
---|---|---|
committer | Kostya Kortchinsky <kostyak@google.com> | 2018-09-21 17:05:56 +0000 |
commit | 7bdb0b9493b6f2bcdab6136a521b218ea334f4ca (patch) | |
tree | d179a9cb34d149482c16c964f5c4f24f8c47af2e /compiler-rt/lib/sanitizer_common | |
parent | c9de3b4d267bf6c7bd2734a1382a65a8812b07d9 (diff) | |
download | bcm5719-llvm-7bdb0b9493b6f2bcdab6136a521b218ea334f4ca.tar.gz bcm5719-llvm-7bdb0b9493b6f2bcdab6136a521b218ea334f4ca.zip |
[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
llvm-svn: 342747
Diffstat (limited to 'compiler-rt/lib/sanitizer_common')
-rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_common.cc | 5 | ||||
-rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_termination.cc | 9 |
2 files changed, 9 insertions, 5 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common.cc b/compiler-rt/lib/sanitizer_common/sanitizer_common.cc index 7d72b0cfe4c..6868961902c 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_common.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_common.cc @@ -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 *)) { diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_termination.cc b/compiler-rt/lib/sanitizer_common/sanitizer_termination.cc index 8243fc05d02..35e4403adfb 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_termination.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_termination.cc @@ -84,3 +84,12 @@ void NORETURN CheckFailed(const char *file, int line, const char *cond, } } // namespace __sanitizer + +using namespace __sanitizer; // NOLINT + +extern "C" { +SANITIZER_INTERFACE_ATTRIBUTE +void __sanitizer_set_death_callback(void (*callback)(void)) { + SetUserDieCallback(callback); +} +} // extern "C" |