diff options
author | Florian Hahn <flo@fhahn.com> | 2019-12-05 08:52:24 +0000 |
---|---|---|
committer | Florian Hahn <flo@fhahn.com> | 2019-12-05 09:06:22 +0000 |
commit | 1b81964586b4f0fde94f4d238be659bedd85b627 (patch) | |
tree | 726d84020db9ad06be7ff39813bf34ce1a487419 /llvm/lib/CodeGen/LiveIntervals.cpp | |
parent | 8b8185bb1b456e0ccf7b1ed1f00bc646853ab004 (diff) | |
download | bcm5719-llvm-1b81964586b4f0fde94f4d238be659bedd85b627.tar.gz bcm5719-llvm-1b81964586b4f0fde94f4d238be659bedd85b627.zip |
[MIBundle] Turn MachineOperandIteratorBase into a forward iterator.
This patch turns MachineOperandIteratorBase into a regular forward
iterator, which can be used with iterator_range.
It also adds mi_bundle_ops and const_mi_bundle_ops that return iterator
ranges over all operands in a bundle and updates a use of the old
iterator.
Reviewers: evandro, t.p.northover, paquette, MatzeB, arsenm
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D70561
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervals.cpp')
-rw-r--r-- | llvm/lib/CodeGen/LiveIntervals.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervals.cpp b/llvm/lib/CodeGen/LiveIntervals.cpp index 600e7880c70..9c80282bc59 100644 --- a/llvm/lib/CodeGen/LiveIntervals.cpp +++ b/llvm/lib/CodeGen/LiveIntervals.cpp @@ -1072,9 +1072,9 @@ private: // Kill flags shouldn't be used while live intervals exist, they will be // reinserted by VirtRegRewriter. if (MachineInstr *KillMI = LIS.getInstructionFromIndex(OldIdxIn->end)) - for (MIBundleOperands MO(*KillMI); MO.isValid(); ++MO) - if (MO->isReg() && MO->isUse()) - MO->setIsKill(false); + for (MachineOperand &MOP : mi_bundle_ops(*KillMI)) + if (MOP.isReg() && MOP.isUse()) + MOP.setIsKill(false); // Is there a def before NewIdx which is not OldIdx? LiveRange::iterator Next = std::next(OldIdxIn); |