summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-03-28 20:11:42 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-03-28 20:11:42 +0000
commit8e58c90f514ce7c333a957455d262f40e5cd7904 (patch)
treed4cfcd43772c9aa1b8c275f3aee146c6cf6afc40
parent72eee39df729a6cc219bce16d53d7fca44954aba (diff)
downloadbcm5719-llvm-8e58c90f514ce7c333a957455d262f40e5cd7904.tar.gz
bcm5719-llvm-8e58c90f514ce7c333a957455d262f40e5cd7904.zip
Allow removeLiveIn to be called with a register that isn't live-in.
This avoids the silly double search: if (isLiveIn(Reg)) removeLiveIn(Reg); llvm-svn: 153592
-rw-r--r--llvm/lib/CodeGen/MachineBasicBlock.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index ca8a8e8072a..6c8a1072697 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -321,8 +321,8 @@ void MachineBasicBlock::print(raw_ostream &OS, SlotIndexes *Indexes) const {
void MachineBasicBlock::removeLiveIn(unsigned Reg) {
std::vector<unsigned>::iterator I =
std::find(LiveIns.begin(), LiveIns.end(), Reg);
- assert(I != LiveIns.end() && "Not a live in!");
- LiveIns.erase(I);
+ if (I != LiveIns.end())
+ LiveIns.erase(I);
}
bool MachineBasicBlock::isLiveIn(unsigned Reg) const {
OpenPOWER on IntegriCloud