[PATCH] D23527: [ADT] Fix DepthFirstIterator's std::iterator base to have normal typedefs

Tim Shen via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 15 15:15:29 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL278753: [ADT] Fix DepthFirstIterator's std::iterator base to have normal typedefs (authored by timshen).

Changed prior to commit:
  https://reviews.llvm.org/D23527?vs=68090&id=68093#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D23527

Files:
  llvm/trunk/include/llvm/ADT/DepthFirstIterator.h
  llvm/trunk/include/llvm/Analysis/RegionInfo.h

Index: llvm/trunk/include/llvm/ADT/DepthFirstIterator.h
===================================================================
--- llvm/trunk/include/llvm/ADT/DepthFirstIterator.h
+++ llvm/trunk/include/llvm/ADT/DepthFirstIterator.h
@@ -64,13 +64,9 @@
               llvm::SmallPtrSet<typename GraphTraits<GraphT>::NodeRef, 8>,
           bool ExtStorage = false, class GT = GraphTraits<GraphT>>
 class df_iterator
-    : public std::iterator<std::forward_iterator_tag, typename GT::NodeRef,
-                           ptrdiff_t, typename GT::NodeRef,
-                           typename GT::NodeRef>,
+    : public std::iterator<std::forward_iterator_tag, typename GT::NodeRef>,
       public df_iterator_storage<SetType, ExtStorage> {
-  typedef std::iterator<std::forward_iterator_tag, typename GT::NodeRef,
-                        ptrdiff_t, typename GT::NodeRef, typename GT::NodeRef>
-      super;
+  typedef std::iterator<std::forward_iterator_tag, typename GT::NodeRef> super;
 
   typedef typename GT::NodeRef NodeRef;
   typedef typename GT::ChildIteratorType ChildItTy;
@@ -145,7 +141,7 @@
   }
   bool operator!=(const df_iterator &x) const { return !(*this == x); }
 
-  NodeRef operator*() const { return VisitStack.back().first; }
+  const NodeRef &operator*() const { return VisitStack.back().first; }
 
   // This is a nonstandard operator-> that dereferences the pointer an extra
   // time... so that you can actually call methods ON the Node, because
Index: llvm/trunk/include/llvm/Analysis/RegionInfo.h
===================================================================
--- llvm/trunk/include/llvm/Analysis/RegionInfo.h
+++ llvm/trunk/include/llvm/Analysis/RegionInfo.h
@@ -568,19 +568,19 @@
 
   public:
     typedef block_iterator_wrapper<IsConst> Self;
-    typedef typename super::pointer pointer;
+    typedef typename super::value_type value_type;
 
     // Construct the begin iterator.
-    block_iterator_wrapper(pointer Entry, pointer Exit)
+    block_iterator_wrapper(value_type Entry, value_type Exit)
         : super(df_begin(Entry)) {
       // Mark the exit of the region as visited, so that the children of the
       // exit and the exit itself, i.e. the block outside the region will never
       // be visited.
       super::Visited.insert(Exit);
     }
 
     // Construct the end iterator.
-    block_iterator_wrapper() : super(df_end<pointer>((BlockT *)nullptr)) {}
+    block_iterator_wrapper() : super(df_end<value_type>((BlockT *)nullptr)) {}
 
     /*implicit*/ block_iterator_wrapper(super I) : super(I) {}
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23527.68093.patch
Type: text/x-patch
Size: 2559 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160815/49e9d79b/attachment.bin>


More information about the llvm-commits mailing list