summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/DenseMap.h
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2010-03-08 20:45:52 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2010-03-08 20:45:52 +0000
commitccb4f2d813380d8cf139062b8c829e4b8b322c0d (patch)
treeff701d50729114747d97849db97f33f60102ba66 /include/llvm/ADT/DenseMap.h
parent7129a67228b622e427cee0688b2cba112515b886 (diff)
downloadllvm-ccb4f2d813380d8cf139062b8c829e4b8b322c0d.tar.gz
llvm-ccb4f2d813380d8cf139062b8c829e4b8b322c0d.tar.bz2
llvm-ccb4f2d813380d8cf139062b8c829e4b8b322c0d.tar.xz
Iterator traits and swap. closes PR6548 and PR6549
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97974 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/DenseMap.h')
-rw-r--r--include/llvm/ADT/DenseMap.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/ADT/DenseMap.h b/include/llvm/ADT/DenseMap.h
index 735090627c..393473bd97 100644
--- a/include/llvm/ADT/DenseMap.h
+++ b/include/llvm/ADT/DenseMap.h
@@ -192,6 +192,13 @@ public:
return true;
}
+ void swap(DenseMap& RHS) {
+ std::swap(NumBuckets, RHS.NumBuckets);
+ std::swap(Buckets, RHS.Buckets);
+ std::swap(NumEntries, RHS.NumEntries);
+ std::swap(NumTombstones, RHS.NumTombstones);
+ }
+
value_type& FindAndConstruct(const KeyT &Key) {
BucketT *TheBucket;
if (LookupBucketFor(Key, TheBucket))