aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/LoopAccessAnalysis.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-06-25 06:57:30 -0700
committerGitHub <noreply@github.com>2024-06-25 06:57:30 -0700
commit1462605ab0a121fc2f652f178c7c13dc0179f10e (patch)
tree9c21b3392874324f9562eccaa32f9a90af36ae56 /llvm/lib/Analysis/LoopAccessAnalysis.cpp
parentc9f083a9940d1d62f77c39f05bb0fc186cc4832c (diff)
downloadllvm-1462605ab0a121fc2f652f178c7c13dc0179f10e.zip
llvm-1462605ab0a121fc2f652f178c7c13dc0179f10e.tar.gz
llvm-1462605ab0a121fc2f652f178c7c13dc0179f10e.tar.bz2
[Analysis] Use range-based for loops (NFC) (#96587)
Diffstat (limited to 'llvm/lib/Analysis/LoopAccessAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/LoopAccessAnalysis.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index 4fd6defd..1f2bdf8 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -612,12 +612,12 @@ void RuntimePointerChecking::printChecks(
OS.indent(Depth) << "Check " << N++ << ":\n";
OS.indent(Depth + 2) << "Comparing group (" << Check1 << "):\n";
- for (unsigned K = 0; K < First.size(); ++K)
- OS.indent(Depth + 2) << *Pointers[First[K]].PointerValue << "\n";
+ for (unsigned K : First)
+ OS.indent(Depth + 2) << *Pointers[K].PointerValue << "\n";
OS.indent(Depth + 2) << "Against group (" << Check2 << "):\n";
- for (unsigned K = 0; K < Second.size(); ++K)
- OS.indent(Depth + 2) << *Pointers[Second[K]].PointerValue << "\n";
+ for (unsigned K : Second)
+ OS.indent(Depth + 2) << *Pointers[K].PointerValue << "\n";
}
}
@@ -627,15 +627,12 @@ void RuntimePointerChecking::print(raw_ostream &OS, unsigned Depth) const {
printChecks(OS, Checks, Depth);
OS.indent(Depth) << "Grouped accesses:\n";
- for (unsigned I = 0; I < CheckingGroups.size(); ++I) {
- const auto &CG = CheckingGroups[I];
-
+ for (const auto &CG : CheckingGroups) {
OS.indent(Depth + 2) << "Group " << &CG << ":\n";
OS.indent(Depth + 4) << "(Low: " << *CG.Low << " High: " << *CG.High
<< ")\n";
- for (unsigned J = 0; J < CG.Members.size(); ++J) {
- OS.indent(Depth + 6) << "Member: " << *Pointers[CG.Members[J]].Expr
- << "\n";
+ for (unsigned Member : CG.Members) {
+ OS.indent(Depth + 6) << "Member: " << *Pointers[Member].Expr << "\n";
}
}
}