summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lib/Support/ManagedStatic.cpp
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2019-01-27 16:42:12 +0000
committerpatrick <patrick@openbsd.org>2019-01-27 16:42:12 +0000
commitb773203fb58f3ef282fb69c832d8710cab5bc82d (patch)
treee75913f147570fbd75169647b144df85b88a038c /gnu/llvm/lib/Support/ManagedStatic.cpp
parenttweak errno in previous (diff)
downloadwireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.tar.xz
wireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.zip
Import LLVM 7.0.1 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/lib/Support/ManagedStatic.cpp')
-rw-r--r--gnu/llvm/lib/Support/ManagedStatic.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/gnu/llvm/lib/Support/ManagedStatic.cpp b/gnu/llvm/lib/Support/ManagedStatic.cpp
index fb7cd070c42..74f71a38502 100644
--- a/gnu/llvm/lib/Support/ManagedStatic.cpp
+++ b/gnu/llvm/lib/Support/ManagedStatic.cpp
@@ -28,9 +28,6 @@ static void initializeMutex() {
}
static sys::Mutex* getManagedStaticMutex() {
- // We need to use a function local static here, since this can get called
- // during a static constructor and we need to guarantee that it's initialized
- // correctly.
llvm::call_once(mutex_init_flag, initializeMutex);
return ManagedStaticMutex;
}
@@ -46,7 +43,7 @@ void ManagedStaticBase::RegisterManagedStatic(void *(*Creator)(),
Ptr.store(Tmp, std::memory_order_release);
DeleterFn = Deleter;
-
+
// Add to list of managed statics.
Next = StaticList;
StaticList = this;
@@ -56,7 +53,7 @@ void ManagedStaticBase::RegisterManagedStatic(void *(*Creator)(),
"Partially initialized ManagedStatic!?");
Ptr = Creator();
DeleterFn = Deleter;
-
+
// Add to list of managed statics.
Next = StaticList;
StaticList = this;
@@ -73,7 +70,7 @@ void ManagedStaticBase::destroy() const {
// Destroy memory.
DeleterFn(Ptr);
-
+
// Cleanup.
Ptr = nullptr;
DeleterFn = nullptr;