From 75ca2ac329f02ab55cffb3f8cb71b63247d65e8d Mon Sep 17 00:00:00 2001 From: Tim Shen Date: Mon, 15 Aug 2016 22:07:30 +0000 Subject: [PATCH] [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 llvm-svn: 278753 --- llvm/include/llvm/ADT/DepthFirstIterator.h | 10 +++------- llvm/include/llvm/Analysis/RegionInfo.h | 6 +++--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/llvm/include/llvm/ADT/DepthFirstIterator.h b/llvm/include/llvm/ADT/DepthFirstIterator.h index 04a19b7..b7a3071 100644 --- a/llvm/include/llvm/ADT/DepthFirstIterator.h +++ b/llvm/include/llvm/ADT/DepthFirstIterator.h @@ -64,13 +64,9 @@ template ::NodeRef, 8>, bool ExtStorage = false, class GT = GraphTraits> class df_iterator - : public std::iterator, + : public std::iterator, public df_iterator_storage { - typedef std::iterator - super; + typedef std::iterator super; typedef typename GT::NodeRef NodeRef; typedef typename GT::ChildIteratorType ChildItTy; @@ -145,7 +141,7 @@ public: } 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 diff --git a/llvm/include/llvm/Analysis/RegionInfo.h b/llvm/include/llvm/Analysis/RegionInfo.h index 10b8476..bb0e800 100644 --- a/llvm/include/llvm/Analysis/RegionInfo.h +++ b/llvm/include/llvm/Analysis/RegionInfo.h @@ -568,10 +568,10 @@ public: public: typedef block_iterator_wrapper 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 @@ -580,7 +580,7 @@ public: } // Construct the end iterator. - block_iterator_wrapper() : super(df_end((BlockT *)nullptr)) {} + block_iterator_wrapper() : super(df_end((BlockT *)nullptr)) {} /*implicit*/ block_iterator_wrapper(super I) : super(I) {} -- 2.7.4