Make SmallSet<whatever*, N> faster by transparently implementing it with
authorChris Lattner <sabre@nondot.org>
Sat, 27 Jan 2007 08:20:15 +0000 (08:20 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 27 Jan 2007 08:20:15 +0000 (08:20 +0000)
SmallPtrSet.  Some clients will need to use SmallPtrSet directly though if
they need to iterate over the set.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33584 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/SmallSet.h

index d78813c6151172e8f36de26c7d76157f23a1a7c2..64eb5814ab93c7603c45e34184acaacc31ce0389 100644 (file)
@@ -15,6 +15,7 @@
 #define LLVM_ADT_SMALLSET_H
 
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/SmallPtrSet.h"
 #include <set>
 
 namespace llvm {
@@ -101,6 +102,10 @@ private:
   }
 };
 
+/// If this set is of pointer values, transparently switch over to using
+/// SmallPtrSet for performance.
+template <typename PointeeType, unsigned N>
+class SmallSet<PointeeType*, N> : public SmallPtrSet<PointeeType*, N> {};
 
 } // end namespace llvm