Skip to content

Commit 7b9bc47

Browse files
[IPO] Use a range-based for loop (NFC)
1 parent 5e9da33 commit 7b9bc47

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

llvm/lib/Transforms/IPO/SampleProfileProbe.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,7 @@ void SampleProfileProber::computeCFGHash() {
186186
std::vector<uint8_t> Indexes;
187187
JamCRC JC;
188188
for (auto &BB : *F) {
189-
auto *TI = BB.getTerminator();
190-
for (unsigned I = 0, E = TI->getNumSuccessors(); I != E; ++I) {
191-
auto *Succ = TI->getSuccessor(I);
189+
for (BasicBlock *Succ : successors(&BB)) {
192190
auto Index = getBlockId(Succ);
193191
for (int J = 0; J < 4; J++)
194192
Indexes.push_back((uint8_t)(Index >> (J * 8)));

0 commit comments

Comments
 (0)