diff options
author | Bob Wilson <bob.wilson@apple.com> | 2010-05-18 23:19:42 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2010-05-18 23:19:42 +0000 |
commit | 055c01d9dc850e089a9e7b9ac77ac8ddb4d72de8 (patch) | |
tree | b84330f783dfc89647f90766077b3c6324a8bc97 /llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp | |
parent | bd130a2962bcd411e74cd8ef3c3a06e408966a3d (diff) | |
download | bcm5719-llvm-055c01d9dc850e089a9e7b9ac77ac8ddb4d72de8.tar.gz bcm5719-llvm-055c01d9dc850e089a9e7b9ac77ac8ddb4d72de8.zip |
Fix a crash when debugging the coalescer. DebugValue instructions are not
in the coalescer's instruction map.
llvm-svn: 104086
Diffstat (limited to 'llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp index 7e13bf72240..f95ac104940 100644 --- a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -837,8 +837,13 @@ SimpleRegisterCoalescing::UpdateRegDefsUses(unsigned SrcReg, unsigned DstReg, UseMI->isRegTiedToDefOperand(&O-&UseMI->getOperand(0)))) UseMI->addRegisterKilled(DstReg, tri_, true); } - DEBUG(dbgs() << "\t\tupdated: " << li_->getInstructionIndex(UseMI) - << "\t" << *UseMI); + + DEBUG({ + dbgs() << "\t\tupdated: "; + if (!UseMI->isDebugValue()) + dbgs() << li_->getInstructionIndex(UseMI) << "\t"; + dbgs() << *UseMI; + }); continue; } @@ -853,8 +858,12 @@ SimpleRegisterCoalescing::UpdateRegDefsUses(unsigned SrcReg, unsigned DstReg, O.setSubReg(SubIdx); O.setReg(DstReg); - DEBUG(dbgs() << "\t\tupdated: " << li_->getInstructionIndex(UseMI) - << "\t" << *UseMI); + DEBUG({ + dbgs() << "\t\tupdated: "; + if (!UseMI->isDebugValue()) + dbgs() << li_->getInstructionIndex(UseMI) << "\t"; + dbgs() << *UseMI; + }); // After updating the operand, check if the machine instruction has // become a copy. If so, update its val# information. |