aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineInstrBundle.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2023-04-08 16:22:39 -0700
committerKazu Hirata <kazu@google.com>2023-04-08 16:22:39 -0700
commitc121f3a9fbf1bcabfd64a62edec79a292e1f7d51 (patch)
tree2c0987b635105079263685dddddffb7dfda5293a /llvm/lib/CodeGen/MachineInstrBundle.cpp
parent376e90fdb4932f405631cce501ea7664cf76a670 (diff)
downloadllvm-c121f3a9fbf1bcabfd64a62edec79a292e1f7d51.zip
llvm-c121f3a9fbf1bcabfd64a62edec79a292e1f7d51.tar.gz
llvm-c121f3a9fbf1bcabfd64a62edec79a292e1f7d51.tar.bz2
[CodeGen] Use range-based for loops (NFC)
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstrBundle.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstrBundle.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineInstrBundle.cpp b/llvm/lib/CodeGen/MachineInstrBundle.cpp
index 0c059a1..c64e577 100644
--- a/llvm/lib/CodeGen/MachineInstrBundle.cpp
+++ b/llvm/lib/CodeGen/MachineInstrBundle.cpp
@@ -58,8 +58,7 @@ bool UnpackMachineBundles::runOnMachineFunction(MachineFunction &MF) {
if (MI->isBundle()) {
while (++MII != MIE && MII->isBundledWithPred()) {
MII->unbundleFromPred();
- for (unsigned i = 0, e = MII->getNumOperands(); i != e; ++i) {
- MachineOperand &MO = MII->getOperand(i);
+ for (MachineOperand &MO : MII->operands()) {
if (MO.isReg() && MO.isInternalRead())
MO.setIsInternalRead(false);
}
@@ -149,8 +148,7 @@ void llvm::finalizeBundle(MachineBasicBlock &MBB,
if (MII->isDebugInstr())
continue;
- for (unsigned i = 0, e = MII->getNumOperands(); i != e; ++i) {
- MachineOperand &MO = MII->getOperand(i);
+ for (MachineOperand &MO : MII->operands()) {
if (!MO.isReg())
continue;
if (MO.isDef()) {