mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-04 06:09:05 +00:00
DebugInfo: Refactor high_pc/low_pc construction into reusable function
For incoming improvements to inlined functions and lexical blocks suggested by Adrian Prantl in review of r203187. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203263 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f456d37c4f
commit
5ba79a9952
@ -412,12 +412,7 @@ DIE *DwarfDebug::updateSubprogramScopeDIE(DwarfCompileUnit *SPCU,
|
||||
}
|
||||
}
|
||||
|
||||
SPCU->addLabelAddress(SPDie, dwarf::DW_AT_low_pc, FunctionBeginSym);
|
||||
if (DwarfVersion < 4 || Triple(Asm->getTargetTriple()).isOSDarwin())
|
||||
SPCU->addLabelAddress(SPDie, dwarf::DW_AT_high_pc, FunctionEndSym);
|
||||
else
|
||||
SPCU->addLabelDelta(SPDie, dwarf::DW_AT_high_pc, FunctionEndSym,
|
||||
FunctionBeginSym);
|
||||
attachLowHighPC(SPCU, SPDie, FunctionBeginSym, FunctionEndSym);
|
||||
|
||||
const TargetRegisterInfo *RI = Asm->TM.getRegisterInfo();
|
||||
MachineLocation Location(RI->getFrameRegister(*Asm->MF));
|
||||
@ -2977,3 +2972,12 @@ void DwarfDebug::addDwarfTypeUnitType(DwarfCompileUnit &CU,
|
||||
|
||||
CU.addDIETypeSignature(RefDie, *NewTU);
|
||||
}
|
||||
|
||||
void DwarfDebug::attachLowHighPC(DwarfCompileUnit *Unit, DIE *D,
|
||||
MCSymbol *Begin, MCSymbol *End) {
|
||||
Unit->addLabelAddress(D, dwarf::DW_AT_low_pc, Begin);
|
||||
if (DwarfVersion < 4 || Triple(Asm->getTargetTriple()).isOSDarwin())
|
||||
Unit->addLabelAddress(D, dwarf::DW_AT_high_pc, End);
|
||||
else
|
||||
Unit->addLabelDelta(D, dwarf::DW_AT_high_pc, End, Begin);
|
||||
}
|
||||
|
@ -680,6 +680,9 @@ class DwarfDebug : public AsmPrinterHandler {
|
||||
/// \brief Return Label immediately following the instruction.
|
||||
MCSymbol *getLabelAfterInsn(const MachineInstr *MI);
|
||||
|
||||
void attachLowHighPC(DwarfCompileUnit *Unit, DIE *D, MCSymbol *Begin,
|
||||
MCSymbol *End);
|
||||
|
||||
public:
|
||||
//===--------------------------------------------------------------------===//
|
||||
// Main entry points.
|
||||
|
Loading…
Reference in New Issue
Block a user