aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveVariables.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2021-11-23 08:54:47 -0800
committerKazu Hirata <kazu@google.com>2021-11-23 08:54:48 -0800
commitd45cb1d7ea911f43922c7f07e2c819cc8592a70d (patch)
tree8191eb436f7fe56f388ce2c688daf0c9983ef215 /llvm/lib/CodeGen/LiveVariables.cpp
parentc075566c8df081c965b690997a06020e1abec962 (diff)
downloadllvm-d45cb1d7ea911f43922c7f07e2c819cc8592a70d.zip
llvm-d45cb1d7ea911f43922c7f07e2c819cc8592a70d.tar.gz
llvm-d45cb1d7ea911f43922c7f07e2c819cc8592a70d.tar.bz2
[llvm] Use range-based for loops (NFC)
Diffstat (limited to 'llvm/lib/CodeGen/LiveVariables.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveVariables.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/LiveVariables.cpp b/llvm/lib/CodeGen/LiveVariables.cpp
index 51ba4b7..e874479 100644
--- a/llvm/lib/CodeGen/LiveVariables.cpp
+++ b/llvm/lib/CodeGen/LiveVariables.cpp
@@ -58,9 +58,9 @@ void LiveVariables::getAnalysisUsage(AnalysisUsage &AU) const {
MachineInstr *
LiveVariables::VarInfo::findKill(const MachineBasicBlock *MBB) const {
- for (unsigned i = 0, e = Kills.size(); i != e; ++i)
- if (Kills[i]->getParent() == MBB)
- return Kills[i];
+ for (MachineInstr *MI : Kills)
+ if (MI->getParent() == MBB)
+ return MI;
return nullptr;
}
@@ -811,8 +811,8 @@ bool LiveVariables::isLiveOut(Register Reg, const MachineBasicBlock &MBB) {
LiveVariables::VarInfo &VI = getVarInfo(Reg);
SmallPtrSet<const MachineBasicBlock *, 8> Kills;
- for (unsigned i = 0, e = VI.Kills.size(); i != e; ++i)
- Kills.insert(VI.Kills[i]->getParent());
+ for (MachineInstr *MI : VI.Kills)
+ Kills.insert(MI->getParent());
// Loop over all of the successors of the basic block, checking to see if
// the value is either live in the block, or if it is killed in the block.