diff options
author | Oliver Stannard <oliver.stannard@linaro.org> | 2021-01-07 09:43:33 +0000 |
---|---|---|
committer | Oliver Stannard <oliver.stannard@linaro.org> | 2021-01-07 09:43:33 +0000 |
commit | 76f6b125cef1f5d949cd8f4049b14f572ecd9ee6 (patch) | |
tree | caf7957f185deb556baa8010067233dc835fe189 /llvm/lib/IR/BasicBlock.cpp | |
parent | d0fa7a05be92617a0262ec8b622f158971a54c54 (diff) | |
download | llvm-76f6b125cef1f5d949cd8f4049b14f572ecd9ee6.zip llvm-76f6b125cef1f5d949cd8f4049b14f572ecd9ee6.tar.gz llvm-76f6b125cef1f5d949cd8f4049b14f572ecd9ee6.tar.bz2 |
Revert "[llvm] Use BasicBlock::phis() (NFC)"
Reverting because this causes crashes on the 2-stage buildbots, for
example http://lab.llvm.org:8011/#/builders/7/builds/1140.
This reverts commit 9b228f107d43341ef73af92865f73a9a076c5a76.
Diffstat (limited to 'llvm/lib/IR/BasicBlock.cpp')
-rw-r--r-- | llvm/lib/IR/BasicBlock.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/IR/BasicBlock.cpp b/llvm/lib/IR/BasicBlock.cpp index 6882118..7f34565 100644 --- a/llvm/lib/IR/BasicBlock.cpp +++ b/llvm/lib/IR/BasicBlock.cpp @@ -440,8 +440,12 @@ BasicBlock *BasicBlock::splitBasicBlockBefore(iterator I, const Twine &BBName) { void BasicBlock::replacePhiUsesWith(BasicBlock *Old, BasicBlock *New) { // N.B. This might not be a complete BasicBlock, so don't assume // that it ends with a non-phi instruction. - for (PHINode &PN : phis()) - PN.replaceIncomingBlockWith(Old, New); + for (iterator II = begin(), IE = end(); II != IE; ++II) { + PHINode *PN = dyn_cast<PHINode>(II); + if (!PN) + break; + PN->replaceIncomingBlockWith(Old, New); + } } void BasicBlock::replaceSuccessorsPhiUsesWith(BasicBlock *Old, |