llvm.org GIT mirror llvm / baddd24
Remove use of reserved identifier & some unnecessary 'inline' keywords git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232307 91177308-0d34-0410-b5e6-96231b3b80d8 David Blaikie 5 years ago
1 changed file(s) with 22 addition(s) and 23 deletion(s). Raw diff Collapse all Expand all
127127
128128 public:
129129 typedef typename super::pointer pointer;
130 typedef df_iterator _Self;
131130
132131 // Provide static begin and end methods as our public "constructors"
133 static inline _Self begin(const GraphT& G) {
134 return _Self(GT::getEntryNode(G));
135 }
136 static inline _Self end(const GraphT& G) { return _Self(); }
132 static df_iterator begin(const GraphT &G) {
133 return df_iterator(GT::getEntryNode(G));
134 }
135 static df_iterator end(const GraphT &G) { return df_iterator(); }
137136
138137 // Static begin and end methods as our public ctors for external iterators
139 static inline _Self begin(const GraphT& G, SetType &S) {
140 return _Self(GT::getEntryNode(G), S);
141 }
142 static inline _Self end(const GraphT& G, SetType &S) { return _Self(S); }
143
144 inline bool operator==(const _Self& x) const {
138 static df_iterator begin(const GraphT &G, SetType &S) {
139 return df_iterator(GT::getEntryNode(G), S);
140 }
141 static df_iterator end(const GraphT &G, SetType &S) { return df_iterator(S); }
142
143 bool operator==(const df_iterator &x) const {
145144 return VisitStack == x.VisitStack;
146145 }
147 inline bool operator!=(const _Self& x) const { return !operator==(x); }
148
149 inline pointer operator*() const {
150 return VisitStack.back().first.getPointer();
151 }
146 bool operator!=(const df_iterator &x) const { return !(*this == x); }
147
148 pointer operator*() const { return VisitStack.back().first.getPointer(); }
152149
153150 // This is a nonstandard operator-> that dereferences the pointer an extra
154151 // time... so that you can actually call methods ON the Node, because
155152 // the contained type is a pointer. This allows BBIt->getTerminator() f.e.
156153 //
157 inline NodeType *operator->() const { return operator*(); }
158
159 inline _Self& operator++() { // Preincrement
154 NodeType *operator->() const { return **this; }
155
156 df_iterator &operator++() { // Preincrement
160157 toNext();
161158 return *this;
162159 }
163160
164161 // skips all children of the current node and traverses to next node
165162 //
166 inline _Self& skipChildren() {
163 df_iterator &skipChildren() {
167164 VisitStack.pop_back();
168165 if (!VisitStack.empty())
169166 toNext();
170167 return *this;
171168 }
172169
173 inline _Self operator++(int) { // Postincrement
174 _Self tmp = *this; ++*this; return tmp;
170 df_iterator operator++(int) { // Postincrement
171 df_iterator tmp = *this;
172 ++*this;
173 return tmp;
175174 }
176175
177176 // nodeVisited - return true if this iterator has already visited the
178177 // specified node. This is public, and will probably be used to iterate over
179178 // nodes that a depth first iteration did not find: ie unreachable nodes.
180179 //
181 inline bool nodeVisited(NodeType *Node) const {
180 bool nodeVisited(NodeType *Node) const {
182181 return this->Visited.count(Node) != 0;
183182 }
184183