Use DW_OP_fbreg when offset is based on frame register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114585 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2010-09-22 21:10:38 +00:00
parent f0633e48eb
commit be90c3a0ea

View File

@ -811,6 +811,16 @@ void DwarfDebug::addAddress(DIE *Die, unsigned Attribute,
const TargetRegisterInfo *RI = Asm->TM.getRegisterInfo(); const TargetRegisterInfo *RI = Asm->TM.getRegisterInfo();
unsigned Reg = RI->getDwarfRegNum(Location.getReg(), false); unsigned Reg = RI->getDwarfRegNum(Location.getReg(), false);
DIEBlock *Block = new (DIEValueAllocator) DIEBlock(); 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 (Location.isReg()) {
if (Reg < 32) { if (Reg < 32) {