diff options
| author | Chris Lattner <sabre@nondot.org> | 2003-04-26 17:38:26 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2003-04-26 17:38:26 +0000 |
| commit | 91e0564f7506248f51d3b6e42c63fbd3ec8a3c73 (patch) | |
| tree | c2418839dc5a6a8b0b807ba57201f166d53ab346 /llvm | |
| parent | 201b4b9c88b649e41c841f56c54f07b0bee8fc12 (diff) | |
| download | bcm5719-llvm-91e0564f7506248f51d3b6e42c63fbd3ec8a3c73.tar.gz bcm5719-llvm-91e0564f7506248f51d3b6e42c63fbd3ec8a3c73.zip | |
Revert last checkin. Note that PHI nodes can use basic blocks also!
llvm-svn: 5956
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/Support/CFG.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/include/llvm/Support/CFG.h b/llvm/include/llvm/Support/CFG.h index e84f1db3ebc..aab0db9712b 100644 --- a/llvm/include/llvm/Support/CFG.h +++ b/llvm/include/llvm/Support/CFG.h @@ -26,7 +26,14 @@ public: typedef PredIterator<_Ptr,_USE_iterator> _Self; typedef typename super::pointer pointer; + inline void advancePastConstants() { + // Loop to ignore non terminator uses (for example PHI nodes)... + while (It != BB->use_end() && !isa<TerminatorInst>(*It)) + ++It; + } + inline PredIterator(_Ptr *bb) : BB(bb), It(bb->use_begin()) { + advancePastConstants(); } inline PredIterator(_Ptr *bb, bool) : BB(bb), It(bb->use_end()) {} @@ -41,7 +48,7 @@ public: inline _Self& operator++() { // Preincrement assert(It != BB->use_end() && "pred_iterator out of range!"); - ++It; + ++It; advancePastConstants(); return *this; } |

