summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2019-08-07 10:57:25 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2019-08-07 10:57:25 +0000
commit3d5360a4398bfa6878f94ca9ac55bc568692c765 (patch)
tree8517d65dccdea329b5f6fa6eced147ed4c219371 /llvm/lib/Support
parentbefde45a6f606429cadd1ea5d57679c1955ef2a8 (diff)
downloadbcm5719-llvm-3d5360a4398bfa6878f94ca9ac55bc568692c765.tar.gz
bcm5719-llvm-3d5360a4398bfa6878f94ca9ac55bc568692c765.zip
Replace llvm::MutexGuard/UniqueLock with their standard equivalents
All supported platforms have <mutex> now, so we don't need our own copies any longer. No functionality change intended. llvm-svn: 368149
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/ManagedStatic.cpp6
-rw-r--r--llvm/lib/Support/Unix/Process.inc4
-rw-r--r--llvm/lib/Support/Unix/Signals.inc1
3 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/Support/ManagedStatic.cpp b/llvm/lib/Support/ManagedStatic.cpp
index 28ceb1a70e4..c51ef96e9f8 100644
--- a/llvm/lib/Support/ManagedStatic.cpp
+++ b/llvm/lib/Support/ManagedStatic.cpp
@@ -13,9 +13,9 @@
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Config/config.h"
#include "llvm/Support/Mutex.h"
-#include "llvm/Support/MutexGuard.h"
#include "llvm/Support/Threading.h"
#include <cassert>
+#include <mutex>
using namespace llvm;
static const ManagedStaticBase *StaticList = nullptr;
@@ -35,7 +35,7 @@ void ManagedStaticBase::RegisterManagedStatic(void *(*Creator)(),
void (*Deleter)(void*)) const {
assert(Creator);
if (llvm_is_multithreaded()) {
- MutexGuard Lock(*getManagedStaticMutex());
+ std::lock_guard<sys::Mutex> Lock(*getManagedStaticMutex());
if (!Ptr.load(std::memory_order_relaxed)) {
void *Tmp = Creator();
@@ -77,7 +77,7 @@ void ManagedStaticBase::destroy() const {
/// llvm_shutdown - Deallocate and destroy all ManagedStatic variables.
void llvm::llvm_shutdown() {
- MutexGuard Lock(*getManagedStaticMutex());
+ std::lock_guard<sys::Mutex> Lock(*getManagedStaticMutex());
while (StaticList)
StaticList->destroy();
diff --git a/llvm/lib/Support/Unix/Process.inc b/llvm/lib/Support/Unix/Process.inc
index 4115ee39658..86101e47391 100644
--- a/llvm/lib/Support/Unix/Process.inc
+++ b/llvm/lib/Support/Unix/Process.inc
@@ -16,7 +16,7 @@
#include "llvm/Config/config.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Mutex.h"
-#include "llvm/Support/MutexGuard.h"
+#include <mutex>
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
@@ -333,7 +333,7 @@ static ManagedStatic<sys::Mutex> TermColorMutex;
static bool terminalHasColors(int fd) {
#ifdef HAVE_TERMINFO
// First, acquire a global lock because these C routines are thread hostile.
- MutexGuard G(*TermColorMutex);
+ std::lock_guard<sys::Mutex> G(*TermColorMutex);
int errret = 0;
if (setupterm(nullptr, fd, &errret) != 0)
diff --git a/llvm/lib/Support/Unix/Signals.inc b/llvm/lib/Support/Unix/Signals.inc
index 634c16aa36c..be05eabfb2e 100644
--- a/llvm/lib/Support/Unix/Signals.inc
+++ b/llvm/lib/Support/Unix/Signals.inc
@@ -43,7 +43,6 @@
#include "llvm/Support/Mutex.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/SaveAndRestore.h"
-#include "llvm/Support/UniqueLock.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <string>
OpenPOWER on IntegriCloud