From d9dc95709eae195a3ea10b08478a7b270a56b820 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Fri, 25 Apr 2014 20:52:08 +0000 Subject: [PATCH] SCC: Use the reference typedef Actually use the `reference` typedef, and remove the private redefinition of `pointer` since it has no users. Using `reference` exposes a problem with r207257, which specified the wrong `value_type` to `iterator_facade_base` (fixed that too). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207270 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/SCCIterator.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/llvm/ADT/SCCIterator.h b/include/llvm/ADT/SCCIterator.h index 79f9ac40633..bc74416ac88 100644 --- a/include/llvm/ADT/SCCIterator.h +++ b/include/llvm/ADT/SCCIterator.h @@ -37,14 +37,14 @@ namespace llvm { /// 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 > -class scc_iterator : public iterator_facade_base< - scc_iterator, std::forward_iterator_tag, - const std::vector, ptrdiff_t> { +class scc_iterator + : public iterator_facade_base< + scc_iterator, std::forward_iterator_tag, + const std::vector, ptrdiff_t> { typedef typename GT::NodeType NodeType; typedef typename GT::ChildIteratorType ChildItTy; typedef std::vector SccTy; typedef typename scc_iterator::reference reference; - typedef typename scc_iterator::pointer pointer; /// Element of VisitStack during DFS. struct StackElement { @@ -118,7 +118,7 @@ public: return *this; } - const SccTy &operator*() const { + reference operator*() const { assert(!CurrentSCC.empty() && "Dereferencing END SCC iterator!"); return CurrentSCC; }