diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2008-04-24 09:06:33 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2008-04-24 09:06:33 +0000 |
| commit | 3980a7911a5d571ffde04868b977ed343e6b55ba (patch) | |
| tree | f81b636cede37ad084042fffce04662a89641d3c /llvm/lib/CodeGen/MachineBasicBlock.cpp | |
| parent | 0b9db52fac508a25362bac94cf40acfb93518426 (diff) | |
| download | bcm5719-llvm-3980a7911a5d571ffde04868b977ed343e6b55ba.tar.gz bcm5719-llvm-3980a7911a5d571ffde04868b977ed343e6b55ba.zip | |
- 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.
llvm-svn: 50209
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/MachineBasicBlock.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index af91a2fb15c..58ca6efcfe2 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -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); |

