From 74964377a66321c05ac6ddeffc1bd49c859ac221 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Wed, 24 Jun 2009 22:16:52 +0000 Subject: [PATCH] Make this thread-safe. llvm-svn: 74129 --- lib/Analysis/IPA/Andersens.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Analysis/IPA/Andersens.cpp b/lib/Analysis/IPA/Andersens.cpp index 8584d06f7a7..a22a2fbd0aa 100644 --- a/lib/Analysis/IPA/Andersens.cpp +++ b/lib/Analysis/IPA/Andersens.cpp @@ -65,6 +65,7 @@ #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/Passes.h" #include "llvm/Support/Debug.h" +#include "llvm/System/Atomic.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/SparseBitVector.h" #include "llvm/ADT/DenseSet.h" @@ -284,7 +285,8 @@ namespace { // Timestamp a node (used for work list prioritization) void Stamp() { - Timestamp = Counter++; + Timestamp = Counter; + sys::AtomicIncrement(&Counter); } bool isRep() const {