X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FADT%2FSmallSet.h;h=cd117f59ba76ee963781ecdbbcf978a4c53590f8;hb=658c62862e470b59aaf25825de64d93fbaf8cb93;hp=75e8c64885a92754dbd5b6ac4e80f52145ec518f;hpb=3a54b3dc87a581c203b18050b4f787b4ca28a12c;p=oota-llvm.git diff --git a/include/llvm/ADT/SmallSet.h b/include/llvm/ADT/SmallSet.h index 75e8c64885a..cd117f59ba7 100644 --- a/include/llvm/ADT/SmallSet.h +++ b/include/llvm/ADT/SmallSet.h @@ -27,13 +27,13 @@ namespace llvm { /// /// Note that this set does not provide a way to iterate over members in the /// set. -template +template > class SmallSet { /// Use a SmallVector to hold the elements here (even though it will never - /// reach it's 'large' stage) to avoid calling the default ctors of elements + /// reach its 'large' stage) to avoid calling the default ctors of elements /// we will never use. SmallVector Vector; - std::set Set; + std::set Set; typedef typename SmallVector::const_iterator VIterator; typedef typename SmallVector::iterator mutable_iterator; public: @@ -76,6 +76,12 @@ public: return true; } + template + void insert(IterT I, IterT E) { + for (; I != E; ++I) + insert(*I); + } + bool erase(const T &V) { if (!isSmall()) return Set.erase(V);