folly: do not disable RW_SPINLOCK_USE_X86_INTRINSIC_ for clang
authorJim Meyering <meyering@fb.com>
Mon, 9 Jun 2014 20:32:26 +0000 (13:32 -0700)
committerAnton Likhtarov <alikhtarov@fb.com>
Mon, 9 Jun 2014 22:36:04 +0000 (15:36 -0700)
Summary:
Without this, we'd see problems like this in tao, when building with clang:
With this change, this now works with clang-3.4 and clang.dev (3.4+).
This change reverts D950285, which change appears to have been made
to accommodate weakness in clang-3.3 or older.

In file included from tao/data_providers/common/simpledp.cpp:7:
./tao/data_providers/common/stats.h:175:18: error: no type named 'RWTicketSpinLockT' in namespace 'folly'
typedef folly::RWTicketSpinLockT<64, true> RWLockType;
~~~~~~~^
./tao/data_providers/common/stats.h:175:35: error: expected member name or ';' after declaration specifiers
typedef folly::RWTicketSpinLockT<64, true> RWLockType;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

Test Plan:
ensure that all of these pass:
fbconfig -r --clang folly/test:rw_spinlock_test && fbmake runtests
fbconfig -r --clang folly/test:rw_spinlock_test && fbmake runtests_opt
fbconfig -r         folly/test:rw_spinlock_test && fbmake runtests_opt
fbconfig -r --clang --with-project-version clang:dev \
folly/test:rw_spinlock_test && fbmake runtests_opt

Reviewed By: delong.j@fb.com

Subscribers: folly@lists, mathieubaudet

FB internal diff: D1370024

Tasks: 4090011

folly/RWSpinLock.h

index dbef63885531a2f728f7418e6b6e7a32efa34259..b3d4dd99cd230a1c7bb18f5170497e7a605764b9 100644 (file)
@@ -108,7 +108,7 @@ pthread_rwlock_t Read        728698     24us       101ns     7.28ms     194us
 
 #include "folly/Portability.h"
 
-#if defined(__GNUC__) && !defined(__clang__) && \
+#if defined(__GNUC__) && \
   (defined(__i386) || FOLLY_X64 || \
    defined(ARCH_K8))
 #define RW_SPINLOCK_USE_X86_INTRINSIC_