diff options
author | Kazu Hirata <kazu@google.com> | 2021-10-31 07:57:36 -0700 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2021-10-31 07:57:36 -0700 |
commit | 1a605f395ff079ced140f04ee743dbfc7fc46ec9 (patch) | |
tree | da7766686c7292c9d7b7b7e7fcd5f66a9eac85ca /llvm/lib/CodeGen/MachineRegisterInfo.cpp | |
parent | 72710af2334849dfaa9419b341617dd457292e7c (diff) | |
download | llvm-1a605f395ff079ced140f04ee743dbfc7fc46ec9.zip llvm-1a605f395ff079ced140f04ee743dbfc7fc46ec9.tar.gz llvm-1a605f395ff079ced140f04ee743dbfc7fc46ec9.tar.bz2 |
[CodeGen] Use make_early_inc_range (NFC)
Diffstat (limited to 'llvm/lib/CodeGen/MachineRegisterInfo.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineRegisterInfo.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineRegisterInfo.cpp b/llvm/lib/CodeGen/MachineRegisterInfo.cpp index 3f6b11e..19bf87d 100644 --- a/llvm/lib/CodeGen/MachineRegisterInfo.cpp +++ b/llvm/lib/CodeGen/MachineRegisterInfo.cpp @@ -383,9 +383,7 @@ void MachineRegisterInfo::replaceRegWith(Register FromReg, Register ToReg) { const TargetRegisterInfo *TRI = getTargetRegisterInfo(); // TODO: This could be more efficient by bulk changing the operands. - for (reg_iterator I = reg_begin(FromReg), E = reg_end(); I != E; ) { - MachineOperand &O = *I; - ++I; + for (MachineOperand &O : llvm::make_early_inc_range(reg_operands(FromReg))) { if (Register::isPhysicalRegister(ToReg)) { O.substPhysReg(ToReg, *TRI); } else { |