diff options
author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-12-06 15:02:22 +0000 |
---|---|---|
committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-12-06 15:02:22 +0000 |
commit | 80cac479bd1e280bab1cd587cb3f9b24979f0c2f (patch) | |
tree | cdd9461a74c8aeac2fda8705da13a92d510ea749 /llvm/include | |
parent | 9cf57186651cbfe91c1c149997c5ed064083b246 (diff) | |
download | bcm5719-llvm-80cac479bd1e280bab1cd587cb3f9b24979f0c2f.tar.gz bcm5719-llvm-80cac479bd1e280bab1cd587cb3f9b24979f0c2f.zip |
Bug fix in operator==() and in method fini().
llvm-svn: 4945
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/Support/SCCIterator.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/include/Support/SCCIterator.h b/llvm/include/Support/SCCIterator.h index 42d4bcb551c..26afdd76e4f 100644 --- a/llvm/include/Support/SCCIterator.h +++ b/llvm/include/Support/SCCIterator.h @@ -176,11 +176,12 @@ public: // Direct loop termination test (I.fini() is more efficient than I == end()) inline bool fini() const { - return VisitStack.empty(); + assert(!CurrentSCC.empty() || VisitStack.empty()); + return CurrentSCC.empty(); } inline bool operator==(const _Self& x) const { - return VisitStack == x.VisitStack; + return VisitStack == x.VisitStack && CurrentSCC == x.CurrentSCC; } inline bool operator!=(const _Self& x) const { return !operator==(x); } @@ -195,11 +196,11 @@ public: // Retrieve a pointer to the current SCC. Returns NULL when done. inline const SccTy* operator*() const { - assert(!CurrentSCC.empty() || fini()); + assert(!CurrentSCC.empty() || VisitStack.empty()); return CurrentSCC.empty()? NULL : &CurrentSCC; } inline SccTy* operator*() { - assert(!CurrentSCC.empty() || fini()); + assert(!CurrentSCC.empty() || VisitStack.empty()); return CurrentSCC.empty()? NULL : &CurrentSCC; } }; |