[llvm-commits] CVS: llvm/include/llvm/ADT/SmallSet.h

Chris Lattner sabre at nondot.org
Sat Jan 27 00:20:31 PST 2007



Changes in directory llvm/include/llvm/ADT:

SmallSet.h updated: 1.5 -> 1.6
---
Log message:

Make SmallSet<whatever*, N> faster by transparently implementing it with
SmallPtrSet.  Some clients will need to use SmallPtrSet directly though if
they need to iterate over the set.


---
Diffs of the changes:  (+5 -0)

 SmallSet.h |    5 +++++
 1 files changed, 5 insertions(+)


Index: llvm/include/llvm/ADT/SmallSet.h
diff -u llvm/include/llvm/ADT/SmallSet.h:1.5 llvm/include/llvm/ADT/SmallSet.h:1.6
--- llvm/include/llvm/ADT/SmallSet.h:1.5	Sat Jan 27 02:14:53 2007
+++ llvm/include/llvm/ADT/SmallSet.h	Sat Jan 27 02:20:15 2007
@@ -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 @@
   }
 };
 
+/// 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
 






More information about the llvm-commits mailing list