summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/ManagedStatic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/ManagedStatic.cpp')
-rw-r--r--llvm/lib/Support/ManagedStatic.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Support/ManagedStatic.cpp b/llvm/lib/Support/ManagedStatic.cpp
index c19f8cb4859..098cccb68df 100644
--- a/llvm/lib/Support/ManagedStatic.cpp
+++ b/llvm/lib/Support/ManagedStatic.cpp
@@ -13,6 +13,7 @@
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Config/config.h"
+#include "llvm/Support/Atomic.h"
#include <cassert>
using namespace llvm;
@@ -27,7 +28,7 @@ void ManagedStaticBase::RegisterManagedStatic(void *(*Creator)(),
void* tmp = Creator ? Creator() : 0;
TsanHappensBefore(this);
- std::atomic_thread_fence(std::memory_order_seq_cst);
+ sys::MemoryFence();
// This write is racy against the first read in the ManagedStatic
// accessors. The race is benign because it does a second read after a
OpenPOWER on IntegriCloud