[llvm] r233890 - [ADT] Increment epoch from DenseMap::swap.
Sanjoy Das
sanjoy at playingwithpointers.com
Wed Apr 1 21:58:12 PDT 2015
Author: sanjoy
Date: Wed Apr 1 23:58:12 2015
New Revision: 233890
URL: http://llvm.org/viewvc/llvm-project?rev=233890&view=rev
Log:
[ADT] Increment epoch from DenseMap::swap.
Swapping DenseMap A with DenseMap B invalidates iterators pointing into
both A and B.
Modified:
llvm/trunk/include/llvm/ADT/DenseMap.h
Modified: llvm/trunk/include/llvm/ADT/DenseMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/DenseMap.h?rev=233890&r1=233889&r2=233890&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/DenseMap.h (original)
+++ llvm/trunk/include/llvm/ADT/DenseMap.h Wed Apr 1 23:58:12 2015
@@ -584,6 +584,8 @@ public:
}
void swap(DenseMap& RHS) {
+ this->incrementEpoch();
+ RHS.incrementEpoch();
std::swap(Buckets, RHS.Buckets);
std::swap(NumEntries, RHS.NumEntries);
std::swap(NumTombstones, RHS.NumTombstones);
More information about the llvm-commits
mailing list