[llvm] r203263 - DebugInfo: Refactor high_pc/low_pc construction into reusable function
David Blaikie
dblaikie at gmail.com
Fri Mar 7 10:49:45 PST 2014
Author: dblaikie
Date: Fri Mar 7 12:49:45 2014
New Revision: 203263
URL: http://llvm.org/viewvc/llvm-project?rev=203263&view=rev
Log:
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.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=203263&r1=203262&r2=203263&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Fri Mar 7 12:49:45 2014
@@ -412,12 +412,7 @@ DIE *DwarfDebug::updateSubprogramScopeDI
}
}
- 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(Dw
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);
+}
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=203263&r1=203262&r2=203263&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Fri Mar 7 12:49:45 2014
@@ -680,6 +680,9 @@ class DwarfDebug : public AsmPrinterHand
/// \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.
More information about the llvm-commits
mailing list