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/Transforms/Utils/InlineFunction.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/Transforms/Utils/InlineFunction.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/InlineFunction.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp index 521b2b2..e480d7b 100644 --- a/llvm/lib/Transforms/Utils/InlineFunction.cpp +++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp @@ -657,9 +657,13 @@ static void HandleInlinedEHPad(InvokeInst *II, BasicBlock *FirstNewBlock, // edge from this block. SmallVector<Value *, 8> UnwindDestPHIValues; BasicBlock *InvokeBB = II->getParent(); - for (PHINode &PHI : UnwindDest->phis()) + for (Instruction &I : *UnwindDest) { // Save the value to use for this edge. - UnwindDestPHIValues.push_back(PHI.getIncomingValueForBlock(InvokeBB)); + PHINode *PHI = dyn_cast<PHINode>(&I); + if (!PHI) + break; + UnwindDestPHIValues.push_back(PHI->getIncomingValueForBlock(InvokeBB)); + } // Add incoming-PHI values to the unwind destination block for the given basic // block, using the values for the original invoke's source block. |