Skip to content

Commit 0d1d95e

Browse files
[Transforms] Use a range-based for loop (NFC) (#105769)
1 parent 1e3dc8c commit 0d1d95e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,9 @@ bool PlaceSafepointsPass::runImpl(Function &F, const TargetLibraryInfo &TLI) {
331331
// and b) edges to distinct loop headers. We need to insert pools on
332332
// each.
333333
SetVector<BasicBlock *> Headers;
334-
for (unsigned i = 0; i < Term->getNumSuccessors(); i++) {
335-
BasicBlock *Succ = Term->getSuccessor(i);
336-
if (DT.dominates(Succ, Term->getParent())) {
334+
for (BasicBlock *Succ : successors(Term->getParent()))
335+
if (DT.dominates(Succ, Term->getParent()))
337336
Headers.insert(Succ);
338-
}
339-
}
340337
assert(!Headers.empty() && "poll location is not a loop latch?");
341338

342339
// The split loop structure here is so that we only need to recalculate

0 commit comments

Comments
 (0)