diff options
author | Kazu Hirata <kazu@google.com> | 2021-02-20 21:46:02 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2021-02-20 21:46:02 -0800 |
commit | 0b417ba20f21c7057cf9c0fed8cbc761331f4022 (patch) | |
tree | ba5412e5f7b6b631d7e398213e1b8dcdaa514781 /llvm/lib/CodeGen/LiveVariables.cpp | |
parent | 9e4033b06bec48b2e9399d24aaa8c975cd3bd10b (diff) | |
download | llvm-0b417ba20f21c7057cf9c0fed8cbc761331f4022.zip llvm-0b417ba20f21c7057cf9c0fed8cbc761331f4022.tar.gz llvm-0b417ba20f21c7057cf9c0fed8cbc761331f4022.tar.bz2 |
[CodeGen] Use range-based for loops (NFC)
Diffstat (limited to 'llvm/lib/CodeGen/LiveVariables.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveVariables.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/LiveVariables.cpp b/llvm/lib/CodeGen/LiveVariables.cpp index 8201baf..e0ef38d 100644 --- a/llvm/lib/CodeGen/LiveVariables.cpp +++ b/llvm/lib/CodeGen/LiveVariables.cpp @@ -774,13 +774,12 @@ void LiveVariables::addNewBlock(MachineBasicBlock *BB, // Record all vreg defs and kills of all instructions in SuccBB. for (; BBI != BBE; ++BBI) { - for (MachineInstr::mop_iterator I = BBI->operands_begin(), - E = BBI->operands_end(); I != E; ++I) { - if (I->isReg() && Register::isVirtualRegister(I->getReg())) { - if (I->isDef()) - Defs.insert(I->getReg()); - else if (I->isKill()) - Kills.insert(I->getReg()); + for (const MachineOperand &Op : BBI->operands()) { + if (Op.isReg() && Register::isVirtualRegister(Op.getReg())) { + if (Op.isDef()) + Defs.insert(Op.getReg()); + else if (Op.isKill()) + Kills.insert(Op.getReg()); } } } |