Skip to content

Commit fc15731

Browse files
[Transforms] Use a range-based for loop (NFC)
1 parent a3f379e commit fc15731

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Scalar/GVN.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2622,8 +2622,8 @@ bool GVNPass::processInstruction(Instruction *I) {
26222622

26232623
// Remember how many outgoing edges there are to every successor.
26242624
SmallDenseMap<BasicBlock *, unsigned, 16> SwitchEdges;
2625-
for (unsigned i = 0, n = SI->getNumSuccessors(); i != n; ++i)
2626-
++SwitchEdges[SI->getSuccessor(i)];
2625+
for (BasicBlock *Succ : successors(Parent))
2626+
++SwitchEdges[Succ];
26272627

26282628
for (SwitchInst::CaseIt i = SI->case_begin(), e = SI->case_end();
26292629
i != e; ++i) {

0 commit comments

Comments
 (0)