aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveInterval.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2021-02-21 19:58:07 -0800
committerKazu Hirata <kazu@google.com>2021-02-21 19:58:07 -0800
commitffba9e596d09a1d41f83102756e145b59d3f8495 (patch)
treeb5cc2badfc7d3f85ea950a1c1335ab4279ca74be /llvm/lib/CodeGen/LiveInterval.cpp
parent5032b5890bb43895012585bd29ff5c3fbd1a7812 (diff)
downloadllvm-ffba9e596d09a1d41f83102756e145b59d3f8495.zip
llvm-ffba9e596d09a1d41f83102756e145b59d3f8495.tar.gz
llvm-ffba9e596d09a1d41f83102756e145b59d3f8495.tar.bz2
[CodeGen] Use range-based for loops (NFC)
Diffstat (limited to 'llvm/lib/CodeGen/LiveInterval.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveInterval.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/LiveInterval.cpp b/llvm/lib/CodeGen/LiveInterval.cpp
index e1fa78d..1eed0ec 100644
--- a/llvm/lib/CodeGen/LiveInterval.cpp
+++ b/llvm/lib/CodeGen/LiveInterval.cpp
@@ -1360,12 +1360,9 @@ unsigned ConnectedVNInfoEqClasses::Classify(const LiveRange &LR) {
void ConnectedVNInfoEqClasses::Distribute(LiveInterval &LI, LiveInterval *LIV[],
MachineRegisterInfo &MRI) {
// Rewrite instructions.
- for (MachineRegisterInfo::reg_iterator RI = MRI.reg_begin(LI.reg()),
- RE = MRI.reg_end();
- RI != RE;) {
- MachineOperand &MO = *RI;
- MachineInstr *MI = RI->getParent();
- ++RI;
+ for (MachineOperand &MO :
+ llvm::make_early_inc_range(MRI.reg_operands(LI.reg()))) {
+ MachineInstr *MI = MO.getParent();
const VNInfo *VNI;
if (MI->isDebugValue()) {
// DBG_VALUE instructions don't have slot indexes, so get the index of