[llvm-commits] [llvm] r91819 - /llvm/trunk/include/llvm/ADT/DenseMap.h

Chris Lattner sabre at nondot.org
Sun Dec 20 23:15:15 PST 2009


Author: lattner
Date: Mon Dec 21 01:15:15 2009
New Revision: 91819

URL: http://llvm.org/viewvc/llvm-project?rev=91819&view=rev
Log:
add a helper ctor.

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=91819&r1=91818&r2=91819&view=diff

==============================================================================
--- llvm/trunk/include/llvm/ADT/DenseMap.h (original)
+++ llvm/trunk/include/llvm/ADT/DenseMap.h Mon Dec 21 01:15:15 2009
@@ -46,7 +46,7 @@
   typedef ValueT mapped_type;
   typedef BucketT value_type;
 
-  DenseMap(const DenseMap& other) {
+  DenseMap(const DenseMap &other) {
     NumBuckets = 0;
     CopyFrom(other);
   }
@@ -55,6 +55,12 @@
     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) {





More information about the llvm-commits mailing list