diff options
| author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-04-25 18:26:45 +0000 |
|---|---|---|
| committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-04-25 18:26:45 +0000 |
| commit | ef869289273078366d1ae0a985448a88d4f48668 (patch) | |
| tree | 96e3b305365cf3b1c9827349b9c00cd2fb1a1740 | |
| parent | 65a7466675ce9ced5a92188ccfa9eaf2b95bb887 (diff) | |
| download | bcm5719-llvm-ef869289273078366d1ae0a985448a88d4f48668.tar.gz bcm5719-llvm-ef869289273078366d1ae0a985448a88d4f48668.zip | |
SCC: Remove non-const operator*()
<rdar://problem/14292693>
llvm-svn: 207254
| -rw-r--r-- | llvm/include/llvm/ADT/SCCIterator.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/include/llvm/ADT/SCCIterator.h b/llvm/include/llvm/ADT/SCCIterator.h index 86bef96168d..4732ef5e91f 100644 --- a/llvm/include/llvm/ADT/SCCIterator.h +++ b/llvm/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 <class GraphT, class GT = GraphTraits<GraphT> > +template <class GraphT, class GT = GraphTraits<GraphT>> class scc_iterator : public std::iterator<std::forward_iterator_tag, - std::vector<typename GT::NodeType>, ptrdiff_t> { + const std::vector<typename GT::NodeType>, + ptrdiff_t> { typedef typename GT::NodeType NodeType; typedef typename GT::ChildIteratorType ChildItTy; typedef std::vector<NodeType *> SccTy; typedef std::iterator<std::forward_iterator_tag, - std::vector<typename GT::NodeType>, ptrdiff_t> super; + const std::vector<typename GT::NodeType>, + 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. /// |

