summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-08-12 03:55:06 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-08-12 03:55:06 +0000
commit42531260b3e0cc6256bd64911fc3db7aea59a68e (patch)
treebb5d1b3e84331a2673079b42a25135d177d5f8e4 /llvm/lib/CodeGen/MachineBasicBlock.cpp
parent1a2cb97f7b6b0a3ad14c7f076b10a1a19834fac7 (diff)
downloadbcm5719-llvm-42531260b3e0cc6256bd64911fc3db7aea59a68e.tar.gz
bcm5719-llvm-42531260b3e0cc6256bd64911fc3db7aea59a68e.zip
Use the range variant of find/find_if instead of unpacking begin/end
If the result of the find is only used to compare against end(), just use is_contained instead. No functionality change is intended. llvm-svn: 278469
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBasicBlock.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index 2c2373f84ea..58f758890d7 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -323,9 +323,8 @@ void MachineBasicBlock::printAsOperand(raw_ostream &OS,
}
void MachineBasicBlock::removeLiveIn(MCPhysReg Reg, LaneBitmask LaneMask) {
- LiveInVector::iterator I = std::find_if(
- LiveIns.begin(), LiveIns.end(),
- [Reg] (const RegisterMaskPair &LI) { return LI.PhysReg == Reg; });
+ LiveInVector::iterator I = find_if(
+ LiveIns, [Reg](const RegisterMaskPair &LI) { return LI.PhysReg == Reg; });
if (I == LiveIns.end())
return;
@@ -335,9 +334,8 @@ void MachineBasicBlock::removeLiveIn(MCPhysReg Reg, LaneBitmask LaneMask) {
}
bool MachineBasicBlock::isLiveIn(MCPhysReg Reg, LaneBitmask LaneMask) const {
- livein_iterator I = std::find_if(
- LiveIns.begin(), LiveIns.end(),
- [Reg] (const RegisterMaskPair &LI) { return LI.PhysReg == Reg; });
+ livein_iterator I = find_if(
+ LiveIns, [Reg](const RegisterMaskPair &LI) { return LI.PhysReg == Reg; });
return I != livein_end() && (I->LaneMask & LaneMask) != 0;
}
@@ -661,11 +659,11 @@ MachineBasicBlock::transferSuccessorsAndUpdatePHIs(MachineBasicBlock *FromMBB) {
}
bool MachineBasicBlock::isPredecessor(const MachineBasicBlock *MBB) const {
- return std::find(pred_begin(), pred_end(), MBB) != pred_end();
+ return is_contained(predecessors(), MBB);
}
bool MachineBasicBlock::isSuccessor(const MachineBasicBlock *MBB) const {
- return std::find(succ_begin(), succ_end(), MBB) != succ_end();
+ return is_contained(successors(), MBB);
}
bool MachineBasicBlock::isLayoutSuccessor(const MachineBasicBlock *MBB) const {
OpenPOWER on IntegriCloud