Use DW_OP_fbreg when offset is based on frame register.

llvm-svn: 114585
This commit is contained in:
Devang Patel 2010-09-22 21:10:38 +00:00
parent 14fefab721
commit 804fcd4794
1 changed files with 10 additions and 0 deletions

View File

@ -811,6 +811,16 @@ void DwarfDebug::addAddress(DIE *Die, unsigned Attribute,
const TargetRegisterInfo *RI = Asm->TM.getRegisterInfo();
unsigned Reg = RI->getDwarfRegNum(Location.getReg(), false);
DIEBlock *Block = new (DIEValueAllocator) DIEBlock();
const TargetRegisterInfo *TRI = Asm->TM.getRegisterInfo();
if (TRI->getFrameRegister(*Asm->MF) == Location.getReg()
&& Location.getOffset()) {
// If variable offset is based in frame register then use fbreg.
addUInt(Block, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_fbreg);
addSInt(Block, 0, dwarf::DW_FORM_sdata, Location.getOffset());
addBlock(Die, Attribute, 0, Block);
return;
}
if (Location.isReg()) {
if (Reg < 32) {