diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-03-28 20:11:42 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-03-28 20:11:42 +0000 |
commit | 78836f0bb2bf5958c1b9f904b0ad0057c77ab75f (patch) | |
tree | c7a75440d60ebd591692eea8c72ef8e7b0927340 /lib/CodeGen/MachineBasicBlock.cpp | |
parent | 89e2b318e2266a7e3fe44151642c1850ec9bd275 (diff) |
Allow removeLiveIn to be called with a register that isn't live-in.
This avoids the silly double search:
if (isLiveIn(Reg))
removeLiveIn(Reg);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153592 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r-- | lib/CodeGen/MachineBasicBlock.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/MachineBasicBlock.cpp b/lib/CodeGen/MachineBasicBlock.cpp index ca8a8e8072..6c8a107269 100644 --- a/lib/CodeGen/MachineBasicBlock.cpp +++ b/lib/CodeGen/MachineBasicBlock.cpp @@ -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 { |