[compiler-rt] r245754 - [MSan] Deprecate __msan_set_death_callback() in favor of __sanitizer_set_death_callback().

Alexey Samsonov via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 21 15:45:12 PDT 2015


Author: samsonov
Date: Fri Aug 21 17:45:12 2015
New Revision: 245754

URL: http://llvm.org/viewvc/llvm-project?rev=245754&view=rev
Log:
[MSan] Deprecate __msan_set_death_callback() in favor of __sanitizer_set_death_callback().

Modified:
    compiler-rt/trunk/include/sanitizer/msan_interface.h
    compiler-rt/trunk/lib/msan/msan.cc
    compiler-rt/trunk/lib/msan/msan.h
    compiler-rt/trunk/lib/msan/msan_linux.cc

Modified: compiler-rt/trunk/include/sanitizer/msan_interface.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/include/sanitizer/msan_interface.h?rev=245754&r1=245753&r2=245754&view=diff
==============================================================================
--- compiler-rt/trunk/include/sanitizer/msan_interface.h (original)
+++ compiler-rt/trunk/include/sanitizer/msan_interface.h Fri Aug 21 17:45:12 2015
@@ -95,8 +95,7 @@ extern "C" {
      a string containing Msan runtime options. See msan_flags.h for details. */
   const char* __msan_default_options();
 
-  /* Sets the callback to be called right before death on error.
-     Passing 0 will unset the callback. */
+  /* Deprecated. Call __sanitizer_set_death_callback instead. */
   void __msan_set_death_callback(void (*callback)(void));
 
 #ifdef __cplusplus

Modified: compiler-rt/trunk/lib/msan/msan.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan.cc?rev=245754&r1=245753&r2=245754&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan.cc (original)
+++ compiler-rt/trunk/lib/msan/msan.cc Fri Aug 21 17:45:12 2015
@@ -90,8 +90,6 @@ bool msan_init_is_running;
 
 int msan_report_count = 0;
 
-void (*death_callback)(void);
-
 // Array of stack origins.
 // FIXME: make it resizable.
 static const uptr kNumStackOriginDescrs = 1024 * 1024;
@@ -623,7 +621,7 @@ void __sanitizer_unaligned_store64(uu64
 }
 
 void __msan_set_death_callback(void (*callback)(void)) {
-  death_callback = callback;
+  SetUserDieCallback(callback);
 }
 
 #if !SANITIZER_SUPPORTS_WEAK_HOOKS

Modified: compiler-rt/trunk/lib/msan/msan.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan.h?rev=245754&r1=245753&r2=245754&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan.h (original)
+++ compiler-rt/trunk/lib/msan/msan.h Fri Aug 21 17:45:12 2015
@@ -224,8 +224,6 @@ class ScopedThreadLocalStateBackup {
   u64 va_arg_overflow_size_tls;
 };
 
-extern void (*death_callback)(void);
-
 void MsanTSDInit(void (*destructor)(void *tsd));
 void *MsanTSDGet();
 void MsanTSDSet(void *tsd);

Modified: compiler-rt/trunk/lib/msan/msan_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/msan_linux.cc?rev=245754&r1=245753&r2=245754&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/msan_linux.cc (original)
+++ compiler-rt/trunk/lib/msan/msan_linux.cc Fri Aug 21 17:45:12 2015
@@ -154,8 +154,6 @@ bool InitShadow(bool init_origins) {
 void MsanDie() {
   if (common_flags()->coverage)
     __sanitizer_cov_dump();
-  if (death_callback)
-    death_callback();
 }
 
 static void MsanAtExit(void) {




More information about the llvm-commits mailing list