llvm.org GIT mirror llvm / d86dbcc
SCC: Remove non-const operator*() <rdar://problem/14292693> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207254 91177308-0d34-0410-b5e6-96231b3b80d8 Duncan P. N. Exon Smith 6 years ago
1 changed file(s) with 5 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
3434 /// This is implemented using Tarjan's DFS algorithm using an internal stack to
3535 /// build up a vector of nodes in a particular SCC. Note that it is a forward
3636 /// iterator and thus you cannot backtrack or re-visit nodes.
37 template >
37 template >
3838 class scc_iterator
3939 : public std::iterator
40 std::vector, ptrdiff_t> {
40 const std::vector,
41 ptrdiff_t> {
4142 typedef typename GT::NodeType NodeType;
4243 typedef typename GT::ChildIteratorType ChildItTy;
4344 typedef std::vector SccTy;
4445 typedef std::iterator
45 std::vector, ptrdiff_t> super;
46 const std::vector,
47 ptrdiff_t> super;
4648 typedef typename super::reference reference;
4749 typedef typename super::pointer pointer;
4850
125127 }
126128
127129 const SccTy &operator*() const {
128 assert(!CurrentSCC.empty() && "Dereferencing END SCC iterator!");
129 return CurrentSCC;
130 }
131 SccTy &operator*() {
132130 assert(!CurrentSCC.empty() && "Dereferencing END SCC iterator!");
133131 return CurrentSCC;
134132 }