diff options
Diffstat (limited to 'include/llvm/Support/CFG.h')
-rw-r--r-- | include/llvm/Support/CFG.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/llvm/Support/CFG.h b/include/llvm/Support/CFG.h index 937472d581..f8cbeb0a50 100644 --- a/include/llvm/Support/CFG.h +++ b/include/llvm/Support/CFG.h @@ -36,8 +36,11 @@ public: inline void advancePastNonPreds() { // Loop to ignore non predecessor uses (for example PHI nodes)... - while (!It.atEnd() && !isa<TerminatorInst>(*It) && !isa<BasicBlock>(*It)) + while (!It.atEnd()) { + if (isa<TerminatorInst>(*It) || isa<BasicBlock>(*It)) + break; ++It; + } } inline PredIterator(_Ptr *bb) : It(bb->use_begin()) { |