mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-16 14:31:16 +00:00
Reduce some code duplication.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159701 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
00f43076a3
commit
caba263c8e
@ -419,27 +419,12 @@ void CompileUnit::addBlockByrefAddress(DbgVariable *&DV, DIE *Die,
|
||||
|
||||
// Decode the original location, and use that as the start of the byref
|
||||
// variable's location.
|
||||
const TargetRegisterInfo *RI = Asm->TM.getRegisterInfo();
|
||||
unsigned Reg = RI->getDwarfRegNum(Location.getReg(), false);
|
||||
DIEBlock *Block = new (DIEValueAllocator) DIEBlock();
|
||||
|
||||
if (Location.isReg()) {
|
||||
if (Reg < 32)
|
||||
addUInt(Block, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_reg0 + Reg);
|
||||
else {
|
||||
addUInt(Block, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_regx);
|
||||
addUInt(Block, 0, dwarf::DW_FORM_udata, Reg);
|
||||
}
|
||||
} else {
|
||||
if (Reg < 32)
|
||||
addUInt(Block, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_breg0 + Reg);
|
||||
else {
|
||||
addUInt(Block, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_bregx);
|
||||
addUInt(Block, 0, dwarf::DW_FORM_udata, Reg);
|
||||
}
|
||||
|
||||
addUInt(Block, 0, dwarf::DW_FORM_sdata, Location.getOffset());
|
||||
}
|
||||
if (Location.isReg())
|
||||
addRegisterOp(Block, Location.getReg());
|
||||
else
|
||||
addRegisterOffset(Block, Location.getReg(), Location.getOffset());
|
||||
|
||||
// If we started with a pointer to the __Block_byref... struct, then
|
||||
// the first thing we need to do is dereference the pointer (DW_OP_deref).
|
||||
|
Loading…
x
Reference in New Issue
Block a user