[llvm] 6628b59 - [TableGen] Use a range-based for loop. NFC (#123443)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 17 21:41:55 PST 2025


Author: Craig Topper
Date: 2025-01-17T21:41:52-08:00
New Revision: 6628b5934df8209396b5946e268301416ad7d9f6

URL: https://github.com/llvm/llvm-project/commit/6628b5934df8209396b5946e268301416ad7d9f6
DIFF: https://github.com/llvm/llvm-project/commit/6628b5934df8209396b5946e268301416ad7d9f6.diff

LOG: [TableGen] Use a range-based for loop. NFC (#123443)

Added: 
    

Modified: 
    llvm/utils/TableGen/Common/CodeGenSchedule.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/utils/TableGen/Common/CodeGenSchedule.cpp b/llvm/utils/TableGen/Common/CodeGenSchedule.cpp
index 0810d15fb35ea9..60e4363b3c0b93 100644
--- a/llvm/utils/TableGen/Common/CodeGenSchedule.cpp
+++ b/llvm/utils/TableGen/Common/CodeGenSchedule.cpp
@@ -1581,22 +1581,16 @@ bool PredTransitions::substituteVariants(const PredTransition &Trans) {
   // Visit each original write sequence.
   for (const auto &WriteSequence : Trans.WriteSequences) {
     // Push a new (empty) write sequence onto all partial Transitions.
-    for (std::vector<PredTransition>::iterator I = TransVec.begin() + StartIdx,
-                                               E = TransVec.end();
-         I != E; ++I) {
-      I->WriteSequences.emplace_back();
-    }
+    for (auto &PT : drop_begin(TransVec, StartIdx))
+      PT.WriteSequences.emplace_back();
     Subst |=
         substituteVariantOperand(WriteSequence, /*IsRead=*/false, StartIdx);
   }
   // Visit each original read sequence.
   for (const auto &ReadSequence : Trans.ReadSequences) {
     // Push a new (empty) read sequence onto all partial Transitions.
-    for (std::vector<PredTransition>::iterator I = TransVec.begin() + StartIdx,
-                                               E = TransVec.end();
-         I != E; ++I) {
-      I->ReadSequences.emplace_back();
-    }
+    for (auto &PT : drop_begin(TransVec, StartIdx))
+      PT.ReadSequences.emplace_back();
     Subst |= substituteVariantOperand(ReadSequence, /*IsRead=*/true, StartIdx);
   }
   return Subst;


        


More information about the llvm-commits mailing list