Add an unwind_to field to basic blocks, making them Users instead of Values.
[oota-llvm.git] / include / llvm / ADT / SmallSet.h
index d78813c6151172e8f36de26c7d76157f23a1a7c2..51efad8e38c0999ca9c65f44b1f1c4dfdc2f1f5c 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by Chris Lattner and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -15,6 +15,7 @@
 #define LLVM_ADT_SMALLSET_H
 
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/SmallPtrSet.h"
 #include <set>
 
 namespace llvm {
@@ -77,7 +78,7 @@ public:
   
   bool erase(const T &V) {
     if (!isSmall())
-      return Set.erase(V).second;
+      return Set.erase(V);
     for (mutable_iterator I = Vector.begin(), E = Vector.end(); I != E; ++I)
       if (*I == V) {
         Vector.erase(I);
@@ -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