aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/InlineSpiller.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2021-11-28 10:04:54 -0800
committerKazu Hirata <kazu@google.com>2021-11-28 10:04:54 -0800
commitc73fc74ce0f85510ebedd9fe8bcad51d53f2465c (patch)
tree0a8278e9ed298fb78e33ba2d49d3d974f8c64059 /llvm/lib/CodeGen/InlineSpiller.cpp
parent8874ada906f6a2ae0c4aa978581a0c9c26b89ffd (diff)
downloadllvm-c73fc74ce0f85510ebedd9fe8bcad51d53f2465c.zip
llvm-c73fc74ce0f85510ebedd9fe8bcad51d53f2465c.tar.gz
llvm-c73fc74ce0f85510ebedd9fe8bcad51d53f2465c.tar.bz2
[llvm] Use range-based for loops (NFC)
Diffstat (limited to 'llvm/lib/CodeGen/InlineSpiller.cpp')
-rw-r--r--llvm/lib/CodeGen/InlineSpiller.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/InlineSpiller.cpp b/llvm/lib/CodeGen/InlineSpiller.cpp
index a258d81..fc5ac45 100644
--- a/llvm/lib/CodeGen/InlineSpiller.cpp
+++ b/llvm/lib/CodeGen/InlineSpiller.cpp
@@ -581,11 +581,9 @@ bool InlineSpiller::reMaterializeFor(LiveInterval &VirtReg, MachineInstr &MI) {
if (!ParentVNI) {
LLVM_DEBUG(dbgs() << "\tadding <undef> flags: ");
- for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) {
- MachineOperand &MO = MI.getOperand(i);
+ for (MachineOperand &MO : MI.operands())
if (MO.isReg() && MO.isUse() && MO.getReg() == VirtReg.reg())
MO.setIsUndef();
- }
LLVM_DEBUG(dbgs() << UseIdx << '\t' << MI);
return true;
}