aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-05-04 00:26:19 -0700
committerGitHub <noreply@github.com>2025-05-04 00:26:19 -0700
commita9699a334bc9666570418a3bed9520bcdc21518b (patch)
tree8106a3ea7b5e04c4e9a47c2348c4fd29f1746900 /llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
parent1add318c176b92f5daba46b3a099aff60aa8d8c8 (diff)
downloadllvm-a9699a334bc9666570418a3bed9520bcdc21518b.zip
llvm-a9699a334bc9666570418a3bed9520bcdc21518b.tar.gz
llvm-a9699a334bc9666570418a3bed9520bcdc21518b.tar.bz2
[CodeGen] Use range-based for loops (NFC) (#138434)
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
index 6bbd130..5d6e7f1 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
@@ -2588,8 +2588,7 @@ void InstrRefBasedLDV::placeMLocPHIs(
auto CollectPHIsForLoc = [&](LocIdx L) {
// Collect the set of defs.
SmallPtrSet<MachineBasicBlock *, 32> DefBlocks;
- for (unsigned int I = 0; I < OrderToBB.size(); ++I) {
- MachineBasicBlock *MBB = OrderToBB[I];
+ for (MachineBasicBlock *MBB : OrderToBB) {
const auto &TransferFunc = MLocTransfer[MBB->getNumber()];
if (TransferFunc.contains(L))
DefBlocks.insert(MBB);
@@ -3800,8 +3799,7 @@ bool InstrRefBasedLDV::ExtendRanges(MachineFunction &MF,
// To mirror old LiveDebugValues, enumerate variables in RPOT order. Otherwise
// the order is unimportant, it just has to be stable.
unsigned VarAssignCount = 0;
- for (unsigned int I = 0; I < OrderToBB.size(); ++I) {
- auto *MBB = OrderToBB[I];
+ for (MachineBasicBlock *MBB : OrderToBB) {
auto *VTracker = &vlocs[MBB->getNumber()];
// Collect each variable with a DBG_VALUE in this block.
for (auto &idx : VTracker->Vars) {