aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2022-01-28 10:36:12 +0100
committerNikita Popov <npopov@redhat.com>2022-01-28 10:36:28 +0100
commit91e5096d82d8c4dbfe6f01527c25e16f5e2ba883 (patch)
tree89e108d56787a1a7b70ec17607ab0c052291f74e /llvm/lib/Transforms/Utils/InlineFunction.cpp
parent96400f179ff640544964f3e51a756e41eb971a43 (diff)
downloadllvm-91e5096d82d8c4dbfe6f01527c25e16f5e2ba883.zip
llvm-91e5096d82d8c4dbfe6f01527c25e16f5e2ba883.tar.gz
llvm-91e5096d82d8c4dbfe6f01527c25e16f5e2ba883.tar.bz2
[InlineFunction] Use phis() iterator (NFC)
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/InlineFunction.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index c9f872f..39f37b4 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -671,12 +671,9 @@ static void HandleInlinedEHPad(InvokeInst *II, BasicBlock *FirstNewBlock,
// edge from this block.
SmallVector<Value *, 8> UnwindDestPHIValues;
BasicBlock *InvokeBB = II->getParent();
- for (Instruction &I : *UnwindDest) {
+ for (PHINode &PHI : UnwindDest->phis()) {
// Save the value to use for this edge.
- PHINode *PHI = dyn_cast<PHINode>(&I);
- if (!PHI)
- break;
- UnwindDestPHIValues.push_back(PHI->getIncomingValueForBlock(InvokeBB));
+ UnwindDestPHIValues.push_back(PHI.getIncomingValueForBlock(InvokeBB));
}
// Add incoming-PHI values to the unwind destination block for the given basic