aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-01-14 12:17:54 -0800
committerKazu Hirata <kazu@google.com>2024-01-14 12:17:54 -0800
commit10b1c29e396ffb83b0da989740382d5db14fcd9c (patch)
tree7324744d32859fbf3ac5c535603c096899a2036b /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
parentbc27f3573d61012771aa3fee2427f0dd5b8a1288 (diff)
downloadllvm-10b1c29e396ffb83b0da989740382d5db14fcd9c.zip
llvm-10b1c29e396ffb83b0da989740382d5db14fcd9c.tar.gz
llvm-10b1c29e396ffb83b0da989740382d5db14fcd9c.tar.bz2
[CodeGen] Use a range-based for loop (NFC)
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FastISel.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index 6d80b28..d213ea8 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -2210,15 +2210,12 @@ Register FastISel::fastEmitZExtFromI1(MVT VT, unsigned Op0) {
/// might result in multiple MBB's for one BB. As such, the start of the
/// BB might correspond to a different MBB than the end.
bool FastISel::handlePHINodesInSuccessorBlocks(const BasicBlock *LLVMBB) {
- const Instruction *TI = LLVMBB->getTerminator();
-
SmallPtrSet<MachineBasicBlock *, 4> SuccsHandled;
FuncInfo.OrigNumPHINodesToUpdate = FuncInfo.PHINodesToUpdate.size();
// Check successor nodes' PHI nodes that expect a constant to be available
// from this block.
- for (unsigned succ = 0, e = TI->getNumSuccessors(); succ != e; ++succ) {
- const BasicBlock *SuccBB = TI->getSuccessor(succ);
+ for (const BasicBlock *SuccBB : successors(LLVMBB)) {
if (!isa<PHINode>(SuccBB->begin()))
continue;
MachineBasicBlock *SuccMBB = FuncInfo.MBBMap[SuccBB];