[C++11] Use std::atomic instead of LLVM's.

No intended functionality change.

llvm-svn: 202652
This commit is contained in:
Benjamin Kramer
2014-03-02 17:08:31 +00:00
parent b5846f9e15
commit 4527fb2f33
4 changed files with 20 additions and 26 deletions

View File

@@ -28,13 +28,13 @@
#include "llvm/Option/ArgList.h"
#include "llvm/Option/OptTable.h"
#include "llvm/Option/Option.h"
#include "llvm/Support/Atomic.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Host.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/system_error.h"
#include <atomic>
#include <sys/stat.h>
using namespace clang;
@@ -1883,8 +1883,8 @@ void BuryPointer(const void *Ptr) {
// is what we want in such case.
static const size_t kGraveYardMaxSize = 16;
LLVM_ATTRIBUTE_UNUSED static const void *GraveYard[kGraveYardMaxSize];
static llvm::sys::cas_flag GraveYardSize;
llvm::sys::cas_flag Idx = llvm::sys::AtomicIncrement(&GraveYardSize) - 1;
static std::atomic<unsigned> GraveYardSize;
unsigned Idx = GraveYardSize++;
if (Idx >= kGraveYardMaxSize)
return;
GraveYard[Idx] = Ptr;