llvm.org GIT mirror llvm / 6ad5a31
Revert last checkin. Note that PHI nodes can use basic blocks also! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5956 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 17 years ago
1 changed file(s) with 8 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
2525 typedef PredIterator<_Ptr,_USE_iterator> _Self;
2626 typedef typename super::pointer pointer;
2727
28 inline void advancePastConstants() {
29 // Loop to ignore non terminator uses (for example PHI nodes)...
30 while (It != BB->use_end() && !isa(*It))
31 ++It;
32 }
33
2834 inline PredIterator(_Ptr *bb) : BB(bb), It(bb->use_begin()) {
35 advancePastConstants();
2936 }
3037 inline PredIterator(_Ptr *bb, bool) : BB(bb), It(bb->use_end()) {}
3138
4047
4148 inline _Self& operator++() { // Preincrement
4249 assert(It != BB->use_end() && "pred_iterator out of range!");
43 ++It;
50 ++It; advancePastConstants();
4451 return *this;
4552 }
4653