[C++11] Use std::atomic instead of LLVM's.
No intended functionality change. llvm-svn: 202652
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user