mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Revert "[C++11] Replace LLVM atomics with std::atomic."
Breaks the MSVC build. DataStream.cpp(44): error C2552: 'llvm::Statistic::Value' : non-aggregates cannot be initialized with initializer list git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202731 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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
|
||||
|
@@ -76,7 +76,7 @@ void Statistic::RegisterStatistic() {
|
||||
StatInfo->addStatistic(this);
|
||||
|
||||
TsanHappensBefore(this);
|
||||
std::atomic_thread_fence(std::memory_order_seq_cst);
|
||||
sys::MemoryFence();
|
||||
// Remember we have been registered.
|
||||
TsanIgnoreWritesBegin();
|
||||
Initialized = true;
|
||||
|
@@ -13,8 +13,8 @@
|
||||
|
||||
#include "llvm/Support/Threading.h"
|
||||
#include "llvm/Config/config.h"
|
||||
#include "llvm/Support/Atomic.h"
|
||||
#include "llvm/Support/Mutex.h"
|
||||
#include <atomic>
|
||||
#include <cassert>
|
||||
|
||||
using namespace llvm;
|
||||
@@ -31,7 +31,7 @@ bool llvm::llvm_start_multithreaded() {
|
||||
|
||||
// We fence here to ensure that all initialization is complete BEFORE we
|
||||
// return from llvm_start_multithreaded().
|
||||
std::atomic_thread_fence(std::memory_order_seq_cst);
|
||||
sys::MemoryFence();
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
@@ -44,7 +44,7 @@ void llvm::llvm_stop_multithreaded() {
|
||||
|
||||
// We fence here to insure that all threaded operations are complete BEFORE we
|
||||
// return from llvm_stop_multithreaded().
|
||||
std::atomic_thread_fence(std::memory_order_seq_cst);
|
||||
sys::MemoryFence();
|
||||
|
||||
multithreaded_mode = false;
|
||||
delete global_lock;
|
||||
|
@@ -81,14 +81,14 @@ raw_ostream *llvm::CreateInfoOutputFile() {
|
||||
static TimerGroup *DefaultTimerGroup = 0;
|
||||
static TimerGroup *getDefaultTimerGroup() {
|
||||
TimerGroup *tmp = DefaultTimerGroup;
|
||||
std::atomic_thread_fence(std::memory_order_seq_cst);
|
||||
sys::MemoryFence();
|
||||
if (tmp) return tmp;
|
||||
|
||||
llvm_acquire_global_lock();
|
||||
tmp = DefaultTimerGroup;
|
||||
if (!tmp) {
|
||||
tmp = new TimerGroup("Miscellaneous Ungrouped Timers");
|
||||
std::atomic_thread_fence(std::memory_order_seq_cst);
|
||||
sys::MemoryFence();
|
||||
DefaultTimerGroup = tmp;
|
||||
}
|
||||
llvm_release_global_lock();
|
||||
|
Reference in New Issue
Block a user