From 71d5a2540a98c81f5bcaeb48805e0e2881f530ef Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 16 Apr 2017 16:01:22 +0000 Subject: Vendor import of llvm trunk r300422: https://llvm.org/svn/llvm-project/llvm/trunk@300422 --- lib/Support/RWMutex.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'lib/Support/RWMutex.cpp') diff --git a/lib/Support/RWMutex.cpp b/lib/Support/RWMutex.cpp index 3b6309cef21a..6c9781c4e2d6 100644 --- a/lib/Support/RWMutex.cpp +++ b/lib/Support/RWMutex.cpp @@ -13,7 +13,6 @@ #include "llvm/Config/config.h" #include "llvm/Support/RWMutex.h" -#include //===----------------------------------------------------------------------===// //=== WARNING: Implementation here must contain only TRULY operating system @@ -22,29 +21,31 @@ #if !defined(LLVM_ENABLE_THREADS) || LLVM_ENABLE_THREADS == 0 // Define all methods as no-ops if threading is explicitly disabled -namespace llvm { + +using namespace llvm; using namespace sys; -RWMutexImpl::RWMutexImpl() { } -RWMutexImpl::~RWMutexImpl() { } + +RWMutexImpl::RWMutexImpl() = default; +RWMutexImpl::~RWMutexImpl() = default; + bool RWMutexImpl::reader_acquire() { return true; } bool RWMutexImpl::reader_release() { return true; } bool RWMutexImpl::writer_acquire() { return true; } bool RWMutexImpl::writer_release() { return true; } -} + #else #if defined(HAVE_PTHREAD_H) && defined(HAVE_PTHREAD_RWLOCK_INIT) #include +#include #include -#include -namespace llvm { +using namespace llvm; using namespace sys; // Construct a RWMutex using pthread calls RWMutexImpl::RWMutexImpl() - : data_(nullptr) { // Declare the pthread_rwlock data structures pthread_rwlock_t* rwlock = @@ -113,8 +114,6 @@ RWMutexImpl::writer_release() return errorcode == 0; } -} - #elif defined(LLVM_ON_UNIX) #include "Unix/RWMutex.inc" #elif defined( LLVM_ON_WIN32) -- cgit v1.2.3