llvm.org GIT mirror llvm / 75712b8
Whoops! Undo r50087, unbreak the build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50088 91177308-0d34-0410-b5e6-96231b3b80d8 Nick Lewycky 12 years ago
1 changed file(s) with 13 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
5252
5353 inline pointer operator*() const {
5454 assert(!It.atEnd() && "pred_iterator out of range!");
55 return cast(*It)->getParent();
55 if (isa(*It)) // not dyn_cast due to const-correctness
56 return cast(*It)->getParent();
57
58 return cast<_Ptr>(*It);
5659 }
5760 inline pointer *operator->() const { return &(operator*()); }
5861
5962 inline _Self& operator++() { // Preincrement
6063 assert(!It.atEnd() && "pred_iterator out of range!");
61 ++It; advancePastNonTerminators();
64 ++It; advancePastNonPreds();
6265 return *this;
6366 }
6467
102105 inline SuccIterator(Term_ T, bool) // end iterator
103106 : Term(T), idx(Term->getNumSuccessors()) {
104107 assert(T && "getTerminator returned null!");
108 if (Term->getParent()->getUnwindDest())
109 ++idx;
105110 }
106111
107112 inline const _Self &operator=(const _Self &I) {
117122 inline bool operator==(const _Self& x) const { return idx == x.idx; }
118123 inline bool operator!=(const _Self& x) const { return !operator==(x); }
119124
120 inline pointer operator*() const { return Term->getSuccessor(idx); }
125 inline pointer operator*() const {
126 if (idx == Term->getNumSuccessors())
127 return Term->getParent()->getUnwindDest();
128
129 return Term->getSuccessor(idx);
130 }
121131 inline pointer operator->() const { return operator*(); }
122132
123133 inline _Self& operator++() { ++idx; return *this; } // Preincrement