aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineRegisterInfo.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2021-02-19 22:44:14 -0800
committerKazu Hirata <kazu@google.com>2021-02-19 22:44:14 -0800
commita205fa5cd9e4f4dfe9b398c7c861c518667f99f9 (patch)
tree0ab10e8dd5a95a60bd6ecb9982d6133af74d4b5a /llvm/lib/CodeGen/MachineRegisterInfo.cpp
parentf169c027d6e0c13f497d140dbddbdf62e5b17d5f (diff)
downloadllvm-a205fa5cd9e4f4dfe9b398c7c861c518667f99f9.zip
llvm-a205fa5cd9e4f4dfe9b398c7c861c518667f99f9.tar.gz
llvm-a205fa5cd9e4f4dfe9b398c7c861c518667f99f9.tar.bz2
[CodeGen] Use range-based for loops (NFC)
Diffstat (limited to 'llvm/lib/CodeGen/MachineRegisterInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineRegisterInfo.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/MachineRegisterInfo.cpp b/llvm/lib/CodeGen/MachineRegisterInfo.cpp
index 5325eda..b789f9d 100644
--- a/llvm/lib/CodeGen/MachineRegisterInfo.cpp
+++ b/llvm/lib/CodeGen/MachineRegisterInfo.cpp
@@ -434,8 +434,8 @@ void MachineRegisterInfo::clearKillFlags(Register Reg) const {
}
bool MachineRegisterInfo::isLiveIn(Register Reg) const {
- for (livein_iterator I = livein_begin(), E = livein_end(); I != E; ++I)
- if ((Register)I->first == Reg || I->second == Reg)
+ for (const std::pair<MCRegister, Register> &LI : liveins())
+ if ((Register)LI.first == Reg || LI.second == Reg)
return true;
return false;
}
@@ -443,18 +443,18 @@ bool MachineRegisterInfo::isLiveIn(Register Reg) const {
/// getLiveInPhysReg - If VReg is a live-in virtual register, return the
/// corresponding live-in physical register.
MCRegister MachineRegisterInfo::getLiveInPhysReg(Register VReg) const {
- for (livein_iterator I = livein_begin(), E = livein_end(); I != E; ++I)
- if (I->second == VReg)
- return I->first;
+ for (const std::pair<MCRegister, Register> &LI : liveins())
+ if (LI.second == VReg)
+ return LI.first;
return MCRegister();
}
/// getLiveInVirtReg - If PReg is a live-in physical register, return the
/// corresponding live-in physical register.
Register MachineRegisterInfo::getLiveInVirtReg(MCRegister PReg) const {
- for (livein_iterator I = livein_begin(), E = livein_end(); I != E; ++I)
- if (I->first == PReg)
- return I->second;
+ for (const std::pair<MCRegister, Register> &LI : liveins())
+ if (LI.first == PReg)
+ return LI.second;
return Register();
}