mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
Reduce some code duplication.
llvm-svn: 159701
This commit is contained in:
parent
723207e88f
commit
8266e56fdb
@ -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…
Reference in New Issue
Block a user