[llvm] 4eb68f5 - [Instrumentation] Use a range-based for loop (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 10 19:05:32 PST 2024


Author: Kazu Hirata
Date: 2024-01-10T19:05:25-08:00
New Revision: 4eb68f53db608465cf557dbdfe85d9b4eb608fff

URL: https://github.com/llvm/llvm-project/commit/4eb68f53db608465cf557dbdfe85d9b4eb608fff
DIFF: https://github.com/llvm/llvm-project/commit/4eb68f53db608465cf557dbdfe85d9b4eb608fff.diff

LOG: [Instrumentation] Use a range-based for loop (NFC)

Added: 
    

Modified: 
    llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
index 44167f4b471c4c..c20fc942eaf0d5 100644
--- a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
+++ b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
@@ -617,9 +617,7 @@ void FuncPGOInstrumentation<Edge, BBInfo>::computeCFGHash() {
   std::vector<uint8_t> Indexes;
   JamCRC JC;
   for (auto &BB : F) {
-    const Instruction *TI = BB.getTerminator();
-    for (unsigned I = 0, E = TI->getNumSuccessors(); I != E; ++I) {
-      BasicBlock *Succ = TI->getSuccessor(I);
+    for (BasicBlock *Succ : successors(&BB)) {
       auto BI = findBBInfo(Succ);
       if (BI == nullptr)
         continue;


        


More information about the llvm-commits mailing list