summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/DenseMap.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-21 07:15:15 +0000
committerChris Lattner <sabre@nondot.org>2009-12-21 07:15:15 +0000
commit6a363782fe4ecba4f0a72c2edf03596004470c4a (patch)
treebed4d11a033da4dd84da3730a8db24367b29852c /include/llvm/ADT/DenseMap.h
parentd5b1f8a8426e82990dafc6e3336fefc6635c8fa4 (diff)
downloadllvm-6a363782fe4ecba4f0a72c2edf03596004470c4a.tar.gz
llvm-6a363782fe4ecba4f0a72c2edf03596004470c4a.tar.bz2
llvm-6a363782fe4ecba4f0a72c2edf03596004470c4a.tar.xz
add a helper ctor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91819 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/DenseMap.h')
-rw-r--r--include/llvm/ADT/DenseMap.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/llvm/ADT/DenseMap.h b/include/llvm/ADT/DenseMap.h
index 8b62f2d8c8..8b161eae73 100644
--- a/include/llvm/ADT/DenseMap.h
+++ b/include/llvm/ADT/DenseMap.h
@@ -46,7 +46,7 @@ public:
typedef ValueT mapped_type;
typedef BucketT value_type;
- DenseMap(const DenseMap& other) {
+ DenseMap(const DenseMap &other) {
NumBuckets = 0;
CopyFrom(other);
}
@@ -55,6 +55,12 @@ public:
init(NumInitBuckets);
}
+ template<typename InputIt>
+ DenseMap(const InputIt &I, const InputIt &E) {
+ init(64);
+ insert(I, E);
+ }
+
~DenseMap() {
const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey();
for (BucketT *P = Buckets, *E = Buckets+NumBuckets; P != E; ++P) {