[llvm] r232462 - Recommit simplification first attempted in r232309 (fixed a bit in r232312, with fixes in r232314)

David Blaikie dblaikie at gmail.com
Mon Mar 16 22:49:46 PDT 2015


Author: dblaikie
Date: Tue Mar 17 00:49:45 2015
New Revision: 232462

URL: http://llvm.org/viewvc/llvm-project?rev=232462&view=rev
Log:
Recommit simplification first attempted in r232309 (fixed a bit in r232312, with fixes in r232314)

Messed it up because I didn't realize there were two different iterators
here (& clearly didn't build any of this... ) - still seems easier to
just use the injected class name than introduce a self typedef.

Modified:
    llvm/trunk/include/llvm/ADT/ImmutableSet.h

Modified: llvm/trunk/include/llvm/ADT/ImmutableSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ImmutableSet.h?rev=232462&r1=232461&r2=232462&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/ImmutableSet.h (original)
+++ llvm/trunk/include/llvm/ADT/ImmutableSet.h Tue Mar 17 00:49:45 2015
@@ -654,7 +654,6 @@ public:
                    Flags=0x3 };
 
   typedef ImutAVLTree<ImutInfo> TreeTy;
-  typedef ImutAVLTreeGenericIterator<ImutInfo> SelfTy;
 
   ImutAVLTreeGenericIterator() {}
   ImutAVLTreeGenericIterator(const TreeTy *Root) {
@@ -696,11 +695,15 @@ public:
     }
   }
 
-  bool operator==(const SelfTy &x) const { return stack == x.stack; }
+  bool operator==(const ImutAVLTreeGenericIterator &x) const {
+    return stack == x.stack;
+  }
 
-  bool operator!=(const SelfTy &x) const { return !operator==(x); }
+  bool operator!=(const ImutAVLTreeGenericIterator &x) const {
+    return !(*this == x);
+  }
 
-  SelfTy &operator++() {
+  ImutAVLTreeGenericIterator &operator++() {
     assert(!stack.empty());
     TreeTy* Current = reinterpret_cast<TreeTy*>(stack.back() & ~Flags);
     assert(Current);
@@ -726,7 +729,7 @@ public:
     return *this;
   }
 
-  SelfTy &operator--() {
+  ImutAVLTreeGenericIterator &operator--() {
     assert(!stack.empty());
     TreeTy* Current = reinterpret_cast<TreeTy*>(stack.back() & ~Flags);
     assert(Current);
@@ -761,7 +764,6 @@ class ImutAVLTreeInOrderIterator
 
 public:
   typedef ImutAVLTree<ImutInfo> TreeTy;
-  typedef ImutAVLTreeInOrderIterator<ImutInfo> SelfTy;
 
   ImutAVLTreeInOrderIterator(const TreeTy* Root) : InternalItr(Root) {
     if (Root)
@@ -770,16 +772,18 @@ public:
 
   ImutAVLTreeInOrderIterator() : InternalItr() {}
 
-  bool operator==(const SelfTy &x) const {
+  bool operator==(const ImutAVLTreeInOrderIterator &x) const {
     return InternalItr == x.InternalItr;
   }
 
-  bool operator!=(const SelfTy &x) const { return !(*this == x); }
+  bool operator!=(const ImutAVLTreeInOrderIterator &x) const {
+    return !(*this == x);
+  }
 
   TreeTy &operator*() const { return *InternalItr; }
   TreeTy *operator->() const { return &*InternalItr; }
 
-  SelfTy &operator++() {
+  ImutAVLTreeInOrderIterator &operator++() {
     do ++InternalItr;
     while (!InternalItr.atEnd() &&
            InternalItr.getVisitState() != InternalIteratorTy::VisitedLeft);
@@ -787,7 +791,7 @@ public:
     return *this;
   }
 
-  SelfTy &operator--() {
+  ImutAVLTreeInOrderIterator &operator--() {
     do --InternalItr;
     while (!InternalItr.atBeginning() &&
            InternalItr.getVisitState() != InternalIteratorTy::VisitedLeft);





More information about the llvm-commits mailing list