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
This commit is contained in:
Jakob Stoklund Olesen 2012-03-28 20:11:42 +00:00
parent 72eee39df7
commit 8e58c90f51
1 changed files with 2 additions and 2 deletions

View File

@ -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 {