[llvm-commits] [llvm] r50087 - /llvm/trunk/include/llvm/Support/CFG.h

Nick Lewycky nicholas at mxc.ca
Mon Apr 21 22:16:51 PDT 2008


Author: nicholas
Date: Tue Apr 22 00:16:51 2008
New Revision: 50087

URL: http://llvm.org/viewvc/llvm-project?rev=50087&view=rev
Log:
Reverse r47989. Part of removing 'unwinds to' support.

Modified:
    llvm/trunk/include/llvm/Support/CFG.h

Modified: llvm/trunk/include/llvm/Support/CFG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CFG.h?rev=50087&r1=50086&r2=50087&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Support/CFG.h (original)
+++ llvm/trunk/include/llvm/Support/CFG.h Tue Apr 22 00:16:51 2008
@@ -53,16 +53,13 @@
 
   inline pointer operator*() const {
     assert(!It.atEnd() && "pred_iterator out of range!");
-    if (isa<TerminatorInst>(*It))      // not dyn_cast due to const-correctness
-      return cast<TerminatorInst>(*It)->getParent();
-
-    return cast<_Ptr>(*It);
+    return cast<TerminatorInst>(*It)->getParent();
   }
   inline pointer *operator->() const { return &(operator*()); }
 
   inline _Self& operator++() {   // Preincrement
     assert(!It.atEnd() && "pred_iterator out of range!");
-    ++It; advancePastNonPreds();
+    ++It; advancePastNonTerminators();
     return *this;
   }
 
@@ -106,8 +103,6 @@
   inline SuccIterator(Term_ T, bool)                       // end iterator
     : Term(T), idx(Term->getNumSuccessors()) {
     assert(T && "getTerminator returned null!");
-    if (Term->getParent()->getUnwindDest())
-      ++idx;
   }
 
   inline const _Self &operator=(const _Self &I) {
@@ -123,12 +118,7 @@
   inline bool operator==(const _Self& x) const { return idx == x.idx; }
   inline bool operator!=(const _Self& x) const { return !operator==(x); }
 
-  inline pointer operator*() const {
-    if (idx == Term->getNumSuccessors())
-      return Term->getParent()->getUnwindDest();
-
-    return Term->getSuccessor(idx);
-  }
+  inline pointer operator*() const { return Term->getSuccessor(idx); }
   inline pointer operator->() const { return operator*(); }
 
   inline _Self& operator++() { ++idx; return *this; } // Preincrement





More information about the llvm-commits mailing list