Bug 847350 - Add/Update MOZ_ASAN/TSAN_BLACKLIST macros. r=waldo
authorChristian Holler <choller@mozilla.com>
Thu, 17 Oct 2013 16:29:11 +0200
changeset 151133 315b927c1934ef5d0b975276d7dbd022a280090b
parent 151132 030f1de777aeed331648e88dcea8053098742e2c
child 151134 e2f94498037340ea57ba004f40352483d0b29d43
push id35075
push usercholler@mozilla.com
push dateThu, 17 Oct 2013 14:59:30 +0000
treeherdermozilla-inbound@315b927c1934 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswaldo
bugs847350
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 847350 - Add/Update MOZ_ASAN/TSAN_BLACKLIST macros. r=waldo
mfbt/Attributes.h
--- a/mfbt/Attributes.h
+++ b/mfbt/Attributes.h
@@ -165,22 +165,41 @@
 #endif
 
 /*
  * MOZ_ASAN_BLACKLIST is a macro to tell AddressSanitizer (a compile-time
  * instrumentation shipped with Clang) to not instrument the annotated function.
  * Furthermore, it will prevent the compiler from inlining the function because
  * inlining currently breaks the blacklisting mechanism of AddressSanitizer.
  */
-#if defined(MOZ_ASAN)
-#  define MOZ_ASAN_BLACKLIST MOZ_NEVER_INLINE __attribute__((no_address_safety_analysis))
-# else
-#  define MOZ_ASAN_BLACKLIST
+#if defined(__has_feature)
+#  if __has_feature(address_sanitizer)
+#    define MOZ_ASAN_BLACKLIST MOZ_NEVER_INLINE __attribute__((no_sanitize_address))
+#  else
+#    define MOZ_ASAN_BLACKLIST /* nothing */
+#  endif
+#else
+#  define MOZ_ASAN_BLACKLIST /* nothing */
 #endif
 
+/*
+ * MOZ_TSAN_BLACKLIST is a macro to tell ThreadSanitizer (a compile-time
+ * instrumentation shipped with Clang) to not instrument the annotated function.
+ * Furthermore, it will prevent the compiler from inlining the function because
+ * inlining currently breaks the blacklisting mechanism of ThreadSanitizer.
+ */
+#if defined(__has_feature)
+#  if __has_feature(thread_sanitizer)
+#    define MOZ_TSAN_BLACKLIST MOZ_NEVER_INLINE __attribute__((no_sanitize_thread))
+#  else
+#    define MOZ_TSAN_BLACKLIST /* nothing */
+#  endif
+#else
+#  define MOZ_TSAN_BLACKLIST /* nothing */
+#endif
 
 #ifdef __cplusplus
 
 /*
  * MOZ_DELETE, specified immediately prior to the ';' terminating an undefined-
  * method declaration, attempts to delete that method from the corresponding
  * class.  An attempt to use the method will always produce an error *at compile
  * time* (instead of sometimes as late as link time) when this macro can be