[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

@@ -14,10 +14,10 @@
#include "llvm/ADT/OwningPtr.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/Atomic.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/YAMLParser.h"
#include <atomic>
using namespace clang;
using namespace clang::vfs;
@@ -828,8 +828,8 @@ vfs::getVFSFromYAML(MemoryBuffer *Buffer, SourceMgr::DiagHandlerTy DiagHandler,
}
UniqueID vfs::getNextVirtualUniqueID() {
static volatile sys::cas_flag UID = 0;
sys::cas_flag ID = llvm::sys::AtomicIncrement(&UID);
static std::atomic<unsigned> UID;
unsigned ID = ++UID;
// The following assumes that uint64_t max will never collide with a real
// dev_t value from the OS.
return UniqueID(std::numeric_limits<uint64_t>::max(), ID);