diff options
author | Kazu Hirata <kazu@google.com> | 2021-02-17 23:58:46 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2021-02-17 23:58:46 -0800 |
commit | 61efa3d93f733c6310abf079cd27f99868c38461 (patch) | |
tree | 7ee890edd7c783f4d1be4bb8c0cd6eee8efd7893 /llvm/lib/CodeGen/ProcessImplicitDefs.cpp | |
parent | e54579307b15ac0adfe96c5422e9cdd228ed1a76 (diff) | |
download | llvm-61efa3d93f733c6310abf079cd27f99868c38461.zip llvm-61efa3d93f733c6310abf079cd27f99868c38461.tar.gz llvm-61efa3d93f733c6310abf079cd27f99868c38461.tar.bz2 |
[CodeGen] Use range-based for loops (NFC)
Diffstat (limited to 'llvm/lib/CodeGen/ProcessImplicitDefs.cpp')
-rw-r--r-- | llvm/lib/CodeGen/ProcessImplicitDefs.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/ProcessImplicitDefs.cpp b/llvm/lib/CodeGen/ProcessImplicitDefs.cpp index ed19f74..d232ca3 100644 --- a/llvm/lib/CodeGen/ProcessImplicitDefs.cpp +++ b/llvm/lib/CodeGen/ProcessImplicitDefs.cpp @@ -143,18 +143,16 @@ bool ProcessImplicitDefs::runOnMachineFunction(MachineFunction &MF) { assert(MRI->isSSA() && "ProcessImplicitDefs only works on SSA form."); assert(WorkList.empty() && "Inconsistent worklist state"); - for (MachineFunction::iterator MFI = MF.begin(), MFE = MF.end(); - MFI != MFE; ++MFI) { + for (MachineBasicBlock &MBB : MF) { // Scan the basic block for implicit defs. - for (MachineBasicBlock::instr_iterator MBBI = MFI->instr_begin(), - MBBE = MFI->instr_end(); MBBI != MBBE; ++MBBI) - if (MBBI->isImplicitDef()) - WorkList.insert(&*MBBI); + for (MachineInstr &MI : MBB) + if (MI.isImplicitDef()) + WorkList.insert(&MI); if (WorkList.empty()) continue; - LLVM_DEBUG(dbgs() << printMBBReference(*MFI) << " has " << WorkList.size() + LLVM_DEBUG(dbgs() << printMBBReference(MBB) << " has " << WorkList.size() << " implicit defs.\n"); Changed = true; |