llvm.org GIT mirror llvm / eeadbe0
[ADT] Fix DepthFirstIterator's std::iterator base to have normal typedefs Summary: This is similiar to r278752, where I found that the std::iterator<...> base can be normal. Reviewers: dblaikie Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23527 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278753 91177308-0d34-0410-b5e6-96231b3b80d8 Tim Shen 3 years ago
2 changed file(s) with 6 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
6363 llvm::SmallPtrSet::NodeRef, 8>,
6464 bool ExtStorage = false, class GT = GraphTraits>
6565 class df_iterator
66 : public std::iterator
67 ptrdiff_t, typename GT::NodeRef,
68 typename GT::NodeRef>,
66 : public std::iterator typename GT::NodeRef>,
6967 public df_iterator_storage {
70 typedef std::iterator
71 ptrdiff_t, typename GT::NodeRef, typename GT::NodeRef>
72 super;
68 typedef std::iterator super;
7369
7470 typedef typename GT::NodeRef NodeRef;
7571 typedef typename GT::ChildIteratorType ChildItTy;
144140 }
145141 bool operator!=(const df_iterator &x) const { return !(*this == x); }
146142
147 NodeRef operator*() const { return VisitStack.back().first; }
143 const NodeRef &operator*() const { return VisitStack.back().first; }
148144
149145 // This is a nonstandard operator-> that dereferences the pointer an extra
150146 // time... so that you can actually call methods ON the Node, because
567567
568568 public:
569569 typedef block_iterator_wrapper Self;
570 typedef typename super::pointer pointer;
570 typedef typename super::value_type value_type;
571571
572572 // Construct the begin iterator.
573 block_iterator_wrapper(pointer Entry, pointer Exit)
573 block_iterator_wrapper(value_type Entry, value_type Exit)
574574 : super(df_begin(Entry)) {
575575 // Mark the exit of the region as visited, so that the children of the
576576 // exit and the exit itself, i.e. the block outside the region will never
579579 }
580580
581581 // Construct the end iterator.
582 block_iterator_wrapper() : super(df_end<pointer>((BlockT *)nullptr)) {}
582 block_iterator_wrapper() : super(df_end<value_type>((BlockT *)nullptr)) {}
583583
584584 /*implicit*/ block_iterator_wrapper(super I) : super(I) {}
585585