1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

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 9764011905
commit 8914755c40

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) {