llvm.org GIT mirror llvm / 1818275
Bug fix in operator==() and in method fini(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4945 91177308-0d34-0410-b5e6-96231b3b80d8 Vikram S. Adve 17 years ago
2 changed file(s) with 10 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
175175
176176 // Direct loop termination test (I.fini() is more efficient than I == end())
177177 inline bool fini() const {
178 return VisitStack.empty();
178 assert(!CurrentSCC.empty() || VisitStack.empty());
179 return CurrentSCC.empty();
179180 }
180181
181182 inline bool operator==(const _Self& x) const {
182 return VisitStack == x.VisitStack;
183 return VisitStack == x.VisitStack && CurrentSCC == x.CurrentSCC;
183184 }
184185 inline bool operator!=(const _Self& x) const { return !operator==(x); }
185186
194195
195196 // Retrieve a pointer to the current SCC. Returns NULL when done.
196197 inline const SccTy* operator*() const {
197 assert(!CurrentSCC.empty() || fini());
198 assert(!CurrentSCC.empty() || VisitStack.empty());
198199 return CurrentSCC.empty()? NULL : &CurrentSCC;
199200 }
200201 inline SccTy* operator*() {
201 assert(!CurrentSCC.empty() || fini());
202 assert(!CurrentSCC.empty() || VisitStack.empty());
202203 return CurrentSCC.empty()? NULL : &CurrentSCC;
203204 }
204205 };
175175
176176 // Direct loop termination test (I.fini() is more efficient than I == end())
177177 inline bool fini() const {
178 return VisitStack.empty();
178 assert(!CurrentSCC.empty() || VisitStack.empty());
179 return CurrentSCC.empty();
179180 }
180181
181182 inline bool operator==(const _Self& x) const {
182 return VisitStack == x.VisitStack;
183 return VisitStack == x.VisitStack && CurrentSCC == x.CurrentSCC;
183184 }
184185 inline bool operator!=(const _Self& x) const { return !operator==(x); }
185186
194195
195196 // Retrieve a pointer to the current SCC. Returns NULL when done.
196197 inline const SccTy* operator*() const {
197 assert(!CurrentSCC.empty() || fini());
198 assert(!CurrentSCC.empty() || VisitStack.empty());
198199 return CurrentSCC.empty()? NULL : &CurrentSCC;
199200 }
200201 inline SccTy* operator*() {
201 assert(!CurrentSCC.empty() || fini());
202 assert(!CurrentSCC.empty() || VisitStack.empty());
202203 return CurrentSCC.empty()? NULL : &CurrentSCC;
203204 }
204205 };