[llvm] 7b9bc47 - [IPO] Use a range-based for loop (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 11 22:48:32 PST 2024
Author: Kazu Hirata
Date: 2024-01-11T22:48:22-08:00
New Revision: 7b9bc4729b2601a075ca3531c3ad30baab174f87
URL: https://github.com/llvm/llvm-project/commit/7b9bc4729b2601a075ca3531c3ad30baab174f87
DIFF: https://github.com/llvm/llvm-project/commit/7b9bc4729b2601a075ca3531c3ad30baab174f87.diff
LOG: [IPO] Use a range-based for loop (NFC)
Added:
Modified:
llvm/lib/Transforms/IPO/SampleProfileProbe.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/IPO/SampleProfileProbe.cpp b/llvm/lib/Transforms/IPO/SampleProfileProbe.cpp
index 8f0b12d0cfedfc..090e5560483edb 100644
--- a/llvm/lib/Transforms/IPO/SampleProfileProbe.cpp
+++ b/llvm/lib/Transforms/IPO/SampleProfileProbe.cpp
@@ -186,9 +186,7 @@ void SampleProfileProber::computeCFGHash() {
std::vector<uint8_t> Indexes;
JamCRC JC;
for (auto &BB : *F) {
- auto *TI = BB.getTerminator();
- for (unsigned I = 0, E = TI->getNumSuccessors(); I != E; ++I) {
- auto *Succ = TI->getSuccessor(I);
+ for (BasicBlock *Succ : successors(&BB)) {
auto Index = getBlockId(Succ);
for (int J = 0; J < 4; J++)
Indexes.push_back((uint8_t)(Index >> (J * 8)));
More information about the llvm-commits
mailing list