Skip to content

[CodeGen] Use range-based for loops (NFC) #97500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -572,11 +572,10 @@ class MemLocFragmentFill {
bool FirstMeet = true;
// LiveIn locs for BB is the meet of the already-processed preds' LiveOut
// locs.
for (auto I = pred_begin(&BB), E = pred_end(&BB); I != E; I++) {
for (const BasicBlock *Pred : predecessors(&BB)) {
// Ignore preds that haven't been processed yet. This is essentially the
// same as initialising all variables to implicit top value (⊤) which is
// the identity value for the meet operation.
const BasicBlock *Pred = *I;
if (!Visited.count(Pred))
continue;

Expand Down Expand Up @@ -941,10 +940,10 @@ class MemLocFragmentFill {
LLVM_DEBUG(dbgs() << BB->getName()
<< " has new OutLocs, add succs to worklist: [ ");
LiveOut[BB] = std::move(LiveSet);
for (auto I = succ_begin(BB), E = succ_end(BB); I != E; I++) {
if (OnPending.insert(*I).second) {
LLVM_DEBUG(dbgs() << I->getName() << " ");
Pending.push(BBToOrder[*I]);
for (BasicBlock *Succ : successors(BB)) {
if (OnPending.insert(Succ).second) {
LLVM_DEBUG(dbgs() << Succ->getName() << " ");
Pending.push(BBToOrder[Succ]);
}
}
LLVM_DEBUG(dbgs() << "]\n");
Expand Down Expand Up @@ -2360,10 +2359,10 @@ bool AssignmentTrackingLowering::run(FunctionVarLocsBuilder *FnVarLocsBuilder) {
LLVM_DEBUG(dbgs() << BB->getName()
<< " has new OutLocs, add succs to worklist: [ ");
LiveOut[BB] = std::move(LiveSet);
for (auto I = succ_begin(BB), E = succ_end(BB); I != E; I++) {
if (OnPending.insert(*I).second) {
LLVM_DEBUG(dbgs() << I->getName() << " ");
Pending.push(BBToOrder[*I]);
for (BasicBlock *Succ : successors(BB)) {
if (OnPending.insert(Succ).second) {
LLVM_DEBUG(dbgs() << Succ->getName() << " ");
Pending.push(BBToOrder[Succ]);
}
}
LLVM_DEBUG(dbgs() << "]\n");
Expand Down
Loading