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 | a971dbdde27fd4ff53dbebdd4aaf87826d081aa2 (patch) | |
tree | 8bbe06c0e7425e9b42ca4352237425ae3a795b65 /lib/CodeGen/MachineBasicBlock.cpp | |
parent | 173405599993582e88b9a4fbd73e5675c2117173 (diff) | |
download | external_llvm-a971dbdde27fd4ff53dbebdd4aaf87826d081aa2.zip external_llvm-a971dbdde27fd4ff53dbebdd4aaf87826d081aa2.tar.gz external_llvm-a971dbdde27fd4ff53dbebdd4aaf87826d081aa2.tar.bz2 |
- 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
Diffstat (limited to 'lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r-- | lib/CodeGen/MachineBasicBlock.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp index af91a2f..58ca6ef 100644 --- a/lib/CodeGen/MachineBasicBlock.cpp +++ b/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); |