Debug info: Fix PR22296 by omitting the DW_AT_location if we lost the

physical register that is described in a DBG_VALUE.

In the testcase the DBG_VALUE describing "p5" becomes unavailable
because the register its address is in is clobbered and we (currently)
aren't smart enough to realize that the value is rematerialized immediately
after the DBG_VALUE and/or is actually a stack slot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227056 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Adrian Prantl
2015-01-25 19:04:08 +00:00
parent 9dbb6a4f63
commit 10543e8587
3 changed files with 383 additions and 4 deletions

View File

@ -92,6 +92,9 @@ bool DwarfExpression::AddMachineRegPiece(unsigned MachineReg,
unsigned PieceSizeInBits,
unsigned PieceOffsetInBits) {
const TargetRegisterInfo *TRI = getTRI();
if (!TRI->isPhysicalRegister(MachineReg))
return false;
int Reg = TRI->getDwarfRegNum(MachineReg, false);
// If this is a valid register number, emit it.