aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-01-27 08:20:15 +0000
committerChris Lattner <sabre@nondot.org>2007-01-27 08:20:15 +0000
commitb358f0254d7b6470b1ed84a97b601ef102b4e88e (patch)
tree7561fd3b66d0bac9ca1fda34270c8b9bcfab03a9
parent894d264f3ee965645656ddd6566acbe4d3a3ed55 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33584 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/ADT/SmallSet.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/ADT/SmallSet.h b/include/llvm/ADT/SmallSet.h
index d78813c615..64eb5814ab 100644
--- a/include/llvm/ADT/SmallSet.h
+++ b/include/llvm/ADT/SmallSet.h
@@ -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