projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b7589c8
)
[ADT] Increment epoch from DenseMap::swap.
author
Sanjoy Das
<sanjoy@playingwithpointers.com>
Thu, 2 Apr 2015 04:58:12 +0000
(
04:58
+0000)
committer
Sanjoy Das
<sanjoy@playingwithpointers.com>
Thu, 2 Apr 2015 04:58:12 +0000
(
04:58
+0000)
Swapping DenseMap A with DenseMap B invalidates iterators pointing into
both A and B.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233890
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/ADT/DenseMap.h
patch
|
blob
|
history
diff --git
a/include/llvm/ADT/DenseMap.h
b/include/llvm/ADT/DenseMap.h
index 443a620d1af0a44396ce0fd3744bb56758bfc0bd..7bfa8b22f7a3a40dde86d50ae15276e14e4faa3d 100644
(file)
--- a/
include/llvm/ADT/DenseMap.h
+++ b/
include/llvm/ADT/DenseMap.h
@@
-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);