aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2021-11-22 20:33:27 -0800
committerKazu Hirata <kazu@google.com>2021-11-22 20:33:28 -0800
commitd5b73a70a0611fc6c082e20acb6ce056980c8323 (patch)
treef2e7f1a5df3e0ee786b04e90833cbd6fb3b15bdb /llvm/lib/CodeGen/MachineFunction.cpp
parentfb99686bfd82061d07877228e4737f98fa4e83d4 (diff)
downloadllvm-d5b73a70a0611fc6c082e20acb6ce056980c8323.zip
llvm-d5b73a70a0611fc6c082e20acb6ce056980c8323.tar.gz
llvm-d5b73a70a0611fc6c082e20acb6ce056980c8323.tar.bz2
[llvm] Use range-based for loops (NFC)
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineFunction.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
index 366d068..28c645d 100644
--- a/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/llvm/lib/CodeGen/MachineFunction.cpp
@@ -1327,9 +1327,9 @@ bool MachineJumpTableInfo::ReplaceMBBInJumpTable(unsigned Idx,
assert(Old != New && "Not making a change?");
bool MadeChange = false;
MachineJumpTableEntry &JTE = JumpTables[Idx];
- for (size_t j = 0, e = JTE.MBBs.size(); j != e; ++j)
- if (JTE.MBBs[j] == Old) {
- JTE.MBBs[j] = New;
+ for (MachineBasicBlock *&MBB : JTE.MBBs)
+ if (MBB == Old) {
+ MBB = New;
MadeChange = true;
}
return MadeChange;
@@ -1342,8 +1342,8 @@ void MachineJumpTableInfo::print(raw_ostream &OS) const {
for (unsigned i = 0, e = JumpTables.size(); i != e; ++i) {
OS << printJumpTableEntryReference(i) << ':';
- for (unsigned j = 0, f = JumpTables[i].MBBs.size(); j != f; ++j)
- OS << ' ' << printMBBReference(*JumpTables[i].MBBs[j]);
+ for (const MachineBasicBlock *MBB : JumpTables[i].MBBs)
+ OS << ' ' << printMBBReference(*MBB);
if (i != e)
OS << '\n';
}