- Check if a register is livein before removing it. It may have already been removed.

- Do not iterate over SmallPtrSet, the order of iteration is not deterministic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50209 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng
2008-04-24 09:06:33 +00:00
parent 1734055999
commit a971dbdde2
3 changed files with 39 additions and 30 deletions
+5
View File
@@ -205,6 +205,11 @@ void MachineBasicBlock::removeLiveIn(unsigned Reg) {
LiveIns.erase(I);
}
bool MachineBasicBlock::isLiveIn(unsigned Reg) const {
const_livein_iterator I = std::find(livein_begin(), livein_end(), Reg);
return I != livein_end();
}
void MachineBasicBlock::moveBefore(MachineBasicBlock *NewAfter) {
MachineFunction::BasicBlockListType &BBList =getParent()->getBasicBlockList();
getParent()->getBasicBlockList().splice(NewAfter, BBList, this);