[compiler-rt] r200747 - tsan: add SANITIZER_INTERFACE_ATTRIBUTE to more callbacks

Dmitry Vyukov dvyukov at google.com
Tue Feb 4 00:46:10 PST 2014


Author: dvyukov
Date: Tue Feb  4 02:46:09 2014
New Revision: 200747

URL: http://llvm.org/viewvc/llvm-project?rev=200747&view=rev
Log:
tsan: add SANITIZER_INTERFACE_ATTRIBUTE to more callbacks
so that it's possible to override them from a dynamic library.


Modified:
    compiler-rt/trunk/lib/tsan/rtl/tsan_flags.cc
    compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.cc

Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_flags.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_flags.cc?rev=200747&r1=200746&r2=200747&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_flags.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_flags.cc Tue Feb  4 02:46:09 2014
@@ -27,7 +27,8 @@ Flags *flags() {
 #ifdef TSAN_EXTERNAL_HOOKS
 extern "C" const char* __tsan_default_options();
 #else
-extern "C" const char *WEAK __tsan_default_options() {
+extern "C" SANITIZER_INTERFACE_ATTRIBUTE
+const char *WEAK __tsan_default_options() {
   return "";
 }
 #endif

Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.cc?rev=200747&r1=200746&r2=200747&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.cc Tue Feb  4 02:46:09 2014
@@ -43,9 +43,11 @@ static char ctx_placeholder[sizeof(Conte
 bool OnFinalize(bool failed);
 void OnInitialize();
 #else
+SANITIZER_INTERFACE_ATTRIBUTE
 bool WEAK OnFinalize(bool failed) {
   return failed;
 }
+SANITIZER_INTERFACE_ATTRIBUTE
 void WEAK OnInitialize() {}
 #endif
 





More information about the llvm-commits mailing list