summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-04-24 09:06:33 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-04-24 09:06:33 +0000
commit3980a7911a5d571ffde04868b977ed343e6b55ba (patch)
treef81b636cede37ad084042fffce04662a89641d3c /llvm/lib/CodeGen/MachineBasicBlock.cpp
parent0b9db52fac508a25362bac94cf40acfb93518426 (diff)
downloadbcm5719-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.cpp5
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);
OpenPOWER on IntegriCloud