[llvm] r203187 - DebugInfo: Emit DW_TAG_subprogram's DW_AT_high_pc as an offset from the low_pc

Adrian Prantl aprantl at apple.com
Fri Mar 7 14:09:16 PST 2014


This was actually Greg’s idea :-)
Ideally they would all be relative to the low_pc of the subprogram, I think.

-- adrian

On Mar 7, 2014, at 14:08, David Blaikie <dblaikie at gmail.com> wrote:

> On Fri, Mar 7, 2014 at 10:41 AM, Adrian Prantl <aprantl at apple.com> wrote:
>> Hi David,
>> 
>> would it make sense to implement a similar change for high/low_pc of TAG_lexical_block, too?
> 
> Oh... good point. I've done this for inlined subprograms in r203295
> since there was already a test case covering that (with a little
> improvement, anyway) - lexical blocks coming soon once I work up a
> test case.
> 
>> 
>> -- adrian
>> 
>> 
>> On Mar 6, 2014, at 17:30, David Blaikie <dblaikie at gmail.com> wrote:
>> 
>>> Author: dblaikie
>>> Date: Thu Mar  6 19:30:55 2014
>>> New Revision: 203187
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=203187&view=rev
>>> Log:
>>> DebugInfo: Emit DW_TAG_subprogram's DW_AT_high_pc as an offset from the low_pc
>>> 
>>> This removes a relocation from each subprogram, reducing link times,
>>> etc.
>>> 
>>> Modified:
>>>   llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
>>>   llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
>>>   llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h
>>>   llvm/trunk/test/DebugInfo/AArch64/dwarfdump.ll
>>>   llvm/trunk/test/DebugInfo/X86/dbg-value-location.ll
>>> 
>>> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=203187&r1=203186&r2=203187&view=diff
>>> ==============================================================================
>>> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
>>> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Thu Mar  6 19:30:55 2014
>>> @@ -413,7 +413,8 @@ DIE *DwarfDebug::updateSubprogramScopeDI
>>>  }
>>> 
>>>  SPCU->addLabelAddress(SPDie, dwarf::DW_AT_low_pc, FunctionBeginSym);
>>> -  SPCU->addLabelAddress(SPDie, dwarf::DW_AT_high_pc, FunctionEndSym);
>>> +  SPCU->addLabelDelta(SPDie, dwarf::DW_AT_high_pc, FunctionEndSym,
>>> +                      FunctionBeginSym);
>>> 
>>>  const TargetRegisterInfo *RI = Asm->TM.getRegisterInfo();
>>>  MachineLocation Location(RI->getFrameRegister(*Asm->MF));
>>> 
>>> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp?rev=203187&r1=203186&r2=203187&view=diff
>>> ==============================================================================
>>> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp (original)
>>> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Thu Mar  6 19:30:55 2014
>>> @@ -320,6 +320,12 @@ void DwarfUnit::addSectionDelta(DIE *Die
>>>    Die->addValue(Attribute, dwarf::DW_FORM_data4, Value);
>>> }
>>> 
>>> +void DwarfUnit::addLabelDelta(DIE *Die, dwarf::Attribute Attribute,
>>> +                              const MCSymbol *Hi, const MCSymbol *Lo) {
>>> +  DIEValue *Value = new (DIEValueAllocator) DIEDelta(Hi, Lo);
>>> +  Die->addValue(Attribute, dwarf::DW_FORM_data4, Value);
>>> +}
>>> +
>>> /// addDIEEntry - Add a DIE attribute data and value.
>>> ///
>>> void DwarfUnit::addDIEEntry(DIE *Die, dwarf::Attribute Attribute, DIE *Entry) {
>>> 
>>> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h?rev=203187&r1=203186&r2=203187&view=diff
>>> ==============================================================================
>>> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h (original)
>>> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h Thu Mar  6 19:30:55 2014
>>> @@ -359,6 +359,10 @@ public:
>>>  void addSectionDelta(DIE *Die, dwarf::Attribute Attribute, const MCSymbol *Hi,
>>>                       const MCSymbol *Lo);
>>> 
>>> +  /// addLabelDelta - Add a label delta attribute data and value.
>>> +  void addLabelDelta(DIE *Die, dwarf::Attribute Attribute, const MCSymbol *Hi,
>>> +                     const MCSymbol *Lo);
>>> +
>>>  /// addDIEEntry - Add a DIE attribute data and value.
>>>  void addDIEEntry(DIE *Die, dwarf::Attribute Attribute, DIE *Entry);
>>> 
>>> 
>>> Modified: llvm/trunk/test/DebugInfo/AArch64/dwarfdump.ll
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/AArch64/dwarfdump.ll?rev=203187&r1=203186&r2=203187&view=diff
>>> ==============================================================================
>>> --- llvm/trunk/test/DebugInfo/AArch64/dwarfdump.ll (original)
>>> +++ llvm/trunk/test/DebugInfo/AArch64/dwarfdump.ll Thu Mar  6 19:30:55 2014
>>> @@ -12,7 +12,7 @@
>>> ; A couple of ABS64s similarly:
>>> 
>>> ; CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
>>> -; CHECK: DW_AT_high_pc [DW_FORM_addr] (0x0000000000000008)
>>> +; CHECK: DW_AT_high_pc [DW_FORM_data4] (0x00000008)
>>> 
>>> define i32 @main() nounwind {
>>>  ret i32 0, !dbg !8
>>> 
>>> Modified: llvm/trunk/test/DebugInfo/X86/dbg-value-location.ll
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/dbg-value-location.ll?rev=203187&r1=203186&r2=203187&view=diff
>>> ==============================================================================
>>> --- llvm/trunk/test/DebugInfo/X86/dbg-value-location.ll (original)
>>> +++ llvm/trunk/test/DebugInfo/X86/dbg-value-location.ll Thu Mar  6 19:30:55 2014
>>> @@ -4,7 +4,7 @@ target datalayout = "e-p:64:64:64-i1:8:8
>>> target triple = "x86_64-apple-darwin10.0.0"
>>> ;Radar 8950491
>>> 
>>> -;CHECK: .long Lset5
>>> +;CHECK: .long Lset6
>>> ;CHECK-NEXT:        ## DW_AT_decl_file
>>> ;CHECK-NEXT:        ## DW_AT_decl_line
>>> ;CHECK-NEXT:        ## DW_AT_type
>>> 
>>> 
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>> 





More information about the llvm-commits mailing list