X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FADT%2FSmallSet.h;h=51efad8e38c0999ca9c65f44b1f1c4dfdc2f1f5c;hb=fc82fabe00b0b820e3c0d7fc9e289bace0295f11;hp=d78813c6151172e8f36de26c7d76157f23a1a7c2;hpb=a5b4760cbd23d49b6d94bc56d85b5a499fa54802;p=oota-llvm.git diff --git a/include/llvm/ADT/SmallSet.h b/include/llvm/ADT/SmallSet.h index d78813c6151..51efad8e38c 100644 --- a/include/llvm/ADT/SmallSet.h +++ b/include/llvm/ADT/SmallSet.h @@ -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 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 +class SmallSet : public SmallPtrSet {}; } // end namespace llvm