diff --git a/include/llvm/ADT/SCCIterator.h b/include/llvm/ADT/SCCIterator.h index 86bef96168d..4732ef5e91f 100644 --- a/include/llvm/ADT/SCCIterator.h +++ b/include/llvm/ADT/SCCIterator.h @@ -35,15 +35,17 @@ namespace llvm { /// This is implemented using Tarjan's DFS algorithm using an internal stack to /// build up a vector of nodes in a particular SCC. Note that it is a forward /// iterator and thus you cannot backtrack or re-visit nodes. -template > +template > class scc_iterator : public std::iterator, ptrdiff_t> { + const std::vector, + ptrdiff_t> { typedef typename GT::NodeType NodeType; typedef typename GT::ChildIteratorType ChildItTy; typedef std::vector SccTy; typedef std::iterator, ptrdiff_t> super; + const std::vector, + ptrdiff_t> super; typedef typename super::reference reference; typedef typename super::pointer pointer; @@ -129,10 +131,6 @@ public: assert(!CurrentSCC.empty() && "Dereferencing END SCC iterator!"); return CurrentSCC; } - SccTy &operator*() { - assert(!CurrentSCC.empty() && "Dereferencing END SCC iterator!"); - return CurrentSCC; - } /// \brief Test if the current SCC has a loop. ///