Make this thread-safe.

llvm-svn: 74129
This commit is contained in:
Owen Anderson 2009-06-24 22:16:52 +00:00
parent 68b4197830
commit 74964377a6

View File

@ -65,6 +65,7 @@
#include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/Passes.h" #include "llvm/Analysis/Passes.h"
#include "llvm/Support/Debug.h" #include "llvm/Support/Debug.h"
#include "llvm/System/Atomic.h"
#include "llvm/ADT/Statistic.h" #include "llvm/ADT/Statistic.h"
#include "llvm/ADT/SparseBitVector.h" #include "llvm/ADT/SparseBitVector.h"
#include "llvm/ADT/DenseSet.h" #include "llvm/ADT/DenseSet.h"
@ -284,7 +285,8 @@ namespace {
// Timestamp a node (used for work list prioritization) // Timestamp a node (used for work list prioritization)
void Stamp() { void Stamp() {
Timestamp = Counter++; Timestamp = Counter;
sys::AtomicIncrement(&Counter);
} }
bool isRep() const { bool isRep() const {