aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2021-11-25 08:55:16 -0800
committerKazu Hirata <kazu@google.com>2021-11-25 08:55:16 -0800
commitbfd5dd1568430a6c1500ed400c4de6028f6a2f3d (patch)
treead874c947ae9a5af3dc61d104ad4fbc391160be5 /llvm/lib/CodeGen/MachineInstr.cpp
parent3e7452a812fa06c5eaae7d089891489222417e92 (diff)
downloadllvm-bfd5dd1568430a6c1500ed400c4de6028f6a2f3d.zip
llvm-bfd5dd1568430a6c1500ed400c4de6028f6a2f3d.tar.gz
llvm-bfd5dd1568430a6c1500ed400c4de6028f6a2f3d.tar.bz2
[llvm] Use range-based for loops (NFC)
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 5c4f75e..aaa8043 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -1490,12 +1490,10 @@ bool MachineInstr::allDefsAreDead() const {
/// instruction to this instruction.
void MachineInstr::copyImplicitOps(MachineFunction &MF,
const MachineInstr &MI) {
- for (unsigned i = MI.getDesc().getNumOperands(), e = MI.getNumOperands();
- i != e; ++i) {
- const MachineOperand &MO = MI.getOperand(i);
+ for (const MachineOperand &MO :
+ llvm::drop_begin(MI.operands(), MI.getDesc().getNumOperands()))
if ((MO.isReg() && MO.isImplicit()) || MO.isRegMask())
addOperand(MF, MO);
- }
}
bool MachineInstr::hasComplexRegisterTies() const {