diff --git a/llvm/include/llvm/Support/RWMutex.h b/llvm/include/llvm/Support/RWMutex.h --- a/llvm/include/llvm/Support/RWMutex.h +++ b/llvm/include/llvm/Support/RWMutex.h @@ -94,14 +94,14 @@ template class SmartRWMutex { // shared_mutex (C++17) is more efficient than shared_timed_mutex (C++14) // on Windows and always available on MSVC except with libc++. +#if !defined(LLVM_USE_RW_MUTEX_IMPL) #if (defined(_MSC_VER) && !defined(_LIBCPP_VERSION)) || __cplusplus > 201402L std::shared_mutex impl; #else -#if !defined(LLVM_USE_RW_MUTEX_IMPL) std::shared_timed_mutex impl; +#endif #else RWMutexImpl impl; -#endif #endif unsigned readers = 0; unsigned writers = 0;