aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-07-14 13:33:28 -0700
committerGitHub <noreply@github.com>2024-07-14 13:33:28 -0700
commit7c15fbae31ab065a370a4f90a5f5b0d51cb11cf8 (patch)
tree349066c0e9db9f3b85ea4517036435ca0240c77e
parent35bb9f158b57a8cccc24bc30d793b176e3219985 (diff)
downloadllvm-7c15fbae31ab065a370a4f90a5f5b0d51cb11cf8.zip
llvm-7c15fbae31ab065a370a4f90a5f5b0d51cb11cf8.tar.gz
llvm-7c15fbae31ab065a370a4f90a5f5b0d51cb11cf8.tar.bz2
[Linker] Use a range-based for loop (NFC) (#98785)
-rw-r--r--llvm/lib/Linker/IRMover.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Linker/IRMover.cpp b/llvm/lib/Linker/IRMover.cpp
index ba8f371..beab194 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