[compiler-rt] r242003 - sanitizer_common: Only use _ReadWriteBarrier when targeting MSVC cl.exe.

Peter Collingbourne peter at pcc.me.uk
Sun Jul 12 17:26:05 PDT 2015


Author: pcc
Date: Sun Jul 12 19:26:04 2015
New Revision: 242003

URL: http://llvm.org/viewvc/llvm-project?rev=242003&view=rev
Log:
sanitizer_common: Only use _ReadWriteBarrier when targeting MSVC cl.exe.

Fixes check-ubsan when self hosting on Windows.

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h?rev=242003&r1=242002&r2=242003&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h Sun Jul 12 19:26:04 2015
@@ -661,7 +661,7 @@ void MaybeStartBackgroudThread();
 // compiler from recognising it and turning it into an actual call to
 // memset/memcpy/etc.
 static inline void SanitizerBreakOptimization(void *arg) {
-#if _MSC_VER
+#if _MSC_VER && !defined(__clang__)
   _ReadWriteBarrier();
 #else
   __asm__ __volatile__("" : : "r" (arg) : "memory");





More information about the llvm-commits mailing list