remove support for stringmap visitors now that iterators exist.
authorChris Lattner <sabre@nondot.org>
Sun, 11 Feb 2007 08:22:15 +0000 (08:22 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 11 Feb 2007 08:22:15 +0000 (08:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34180 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/StringMap.h
lib/Support/StringMap.cpp

index 1865e7f48a3f433bbeb028d57c4813fe9e61203d..52982589f792b142b8b82afb93c62e475e183902 100644 (file)
@@ -33,14 +33,6 @@ public:
   unsigned getKeyLength() const { return StrLen; }
 };
   
-/// StringMapVisitor - Subclasses of this class may be implemented to walk all
-/// of the items in a StringMap.
-class StringMapVisitor {
-public:
-  virtual ~StringMapVisitor();
-  virtual void Visit(const char *Key, StringMapEntryBase *Value) const = 0;
-};
-
 /// StringMapImpl - This is the base class of StringMap that is shared among
 /// all of its instantiations.
 class StringMapImpl {
@@ -82,8 +74,6 @@ public:
 
   bool empty() const { return NumItems == 0; }
   unsigned size() const { return NumItems; }
-  
-  void VisitEntries(const StringMapVisitor &Visitor) const;
 };
 
 /// StringMapEntry - This is used to represent one value that is inserted into
index d56d1da6647ce957d4069f67f26319f4fabf5409..5a3896424e72474ce4776757e303e9d3550915d8 100644 (file)
@@ -15,9 +15,6 @@
 #include <cassert>
 using namespace llvm;
 
-StringMapVisitor::~StringMapVisitor() {
-}
-
 StringMapImpl::StringMapImpl(unsigned InitSize, unsigned itemSize) {
   assert((InitSize & (InitSize-1)) == 0 &&
          "Init Size must be a power of 2 or zero!");
@@ -133,13 +130,3 @@ void StringMapImpl::RehashTable() {
   TheTable = NewTableArray;
   NumBuckets = NewSize;
 }
-
-
-/// VisitEntries - This method walks through all of the items,
-/// invoking Visitor.Visit for each of them.
-void StringMapImpl::VisitEntries(const StringMapVisitor &Visitor) const {
-  for (ItemBucket *IB = TheTable, *E = TheTable+NumBuckets; IB != E; ++IB) {
-    if (StringMapEntryBase *Id = IB->Item)
-      Visitor.Visit((char*)Id + ItemSize, Id);
-  }
-}