diff options
author | Dale Johannesen <dalej@apple.com> | 2010-02-11 18:23:23 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2010-02-11 18:23:23 +0000 |
commit | 39c7a198ea0e10ec258c7df6bba25d4bcaf0792c (patch) | |
tree | cf6ff4c2ed82670ac7b6912c8240fca661a68730 /lib/CodeGen/DeadMachineInstructionElim.cpp | |
parent | 3bfef03eb6eb6b1b8fe85ba1029ef709aaafe8af (diff) |
Allow for more than one DBG_VALUE targeting the
same dead instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95890 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/DeadMachineInstructionElim.cpp')
-rw-r--r-- | lib/CodeGen/DeadMachineInstructionElim.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/DeadMachineInstructionElim.cpp b/lib/CodeGen/DeadMachineInstructionElim.cpp index 6e01e59349..7ed1a6af18 100644 --- a/lib/CodeGen/DeadMachineInstructionElim.cpp +++ b/lib/CodeGen/DeadMachineInstructionElim.cpp @@ -117,10 +117,10 @@ bool DeadMachineInstructionElim::runOnMachineFunction(MachineFunction &MF) { // the former operand will then be deleted normally. if (MI->getNumOperands()==3 && MI->getOperand(0).isReg()) { unsigned Reg = MI->getOperand(0).getReg(); - MachineRegisterInfo::use_iterator I = MRI->use_begin(Reg); - assert(I != MRI->use_end()); - if (++I == MRI->use_end()) - // only one use, which must be this DBG_VALUE. + MachineRegisterInfo::use_nodbg_iterator I = MRI->use_nodbg_begin(Reg); + if (I == MRI->use_nodbg_end()) + // All uses are DBG_VALUEs. Nullify this one; if we find + // others later we will nullify them then. MI->getOperand(0).setReg(0U); } } |