[llvm] 7c15fba - [Linker] Use a range-based for loop (NFC) (#98785)

via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 14 13:33:31 PDT 2024


Author: Kazu Hirata
Date: 2024-07-14T13:33:28-07:00
New Revision: 7c15fbae31ab065a370a4f90a5f5b0d51cb11cf8

URL: https://github.com/llvm/llvm-project/commit/7c15fbae31ab065a370a4f90a5f5b0d51cb11cf8
DIFF: https://github.com/llvm/llvm-project/commit/7c15fbae31ab065a370a4f90a5f5b0d51cb11cf8.diff

LOG: [Linker] Use a range-based for loop (NFC) (#98785)

Added: 
    

Modified: 
    llvm/lib/Linker/IRMover.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Linker/IRMover.cpp b/llvm/lib/Linker/IRMover.cpp
index ba8f371127764..beab194a52b81 100644
--- a/llvm/lib/Linker/IRMover.cpp
+++ b/llvm/lib/Linker/IRMover.cpp
@@ -1192,8 +1192,8 @@ void IRLinker::prepareCompileUnitsForImport() {
   // When importing for ThinLTO, prevent importing of types listed on
   // the DICompileUnit that we don't need a copy of in the importing
   // module. They will be emitted by the originating module.
-  for (unsigned I = 0, E = SrcCompileUnits->getNumOperands(); I != E; ++I) {
-    auto *CU = cast<DICompileUnit>(SrcCompileUnits->getOperand(I));
+  for (MDNode *N : SrcCompileUnits->operands()) {
+    auto *CU = cast<DICompileUnit>(N);
     assert(CU && "Expected valid compile unit");
     // Enums, macros, and retained types don't need to be listed on the
     // imported DICompileUnit. This means they will only be imported


        


More information about the llvm-commits mailing list