diff options
author | David Blaikie <dblaikie@gmail.com> | 2018-10-20 07:36:39 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2018-10-20 07:36:39 +0000 |
commit | c4af8bf29fe0f413229f67909cfeb0a427afcd67 (patch) | |
tree | ded6eb43aa8d98b3981b7dfc7c82826d879b36fa /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | |
parent | 59ac20643335b69c8023fc62a95d5b59a73e604a (diff) | |
download | llvm-c4af8bf29fe0f413229f67909cfeb0a427afcd67.zip llvm-c4af8bf29fe0f413229f67909cfeb0a427afcd67.tar.gz llvm-c4af8bf29fe0f413229f67909cfeb0a427afcd67.tar.bz2 |
DebugInfo: Use address pool forms in debug_rnglists
Save no relocations by reusing addresses from the address pool.
llvm-svn: 344836
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 5731541..f638087 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -424,24 +424,30 @@ void DwarfCompileUnit::addScopeRangeList(DIE &ScopeDIE, ? TLOF.getDwarfRnglistsSection()->getBeginSymbol() : TLOF.getDwarfRangesSection()->getBeginSymbol(); - RangeSpanList List(Asm->createTempSymbol("debug_ranges"), std::move(Range)); + HasRangeLists = true; + + // Add the range list to the set of ranges to be emitted. + auto IndexAndList = + (DD->getDwarfVersion() < 5 && Skeleton ? Skeleton->DU : DU) + ->addRange((Skeleton ? Skeleton->BaseAddress : BaseAddress), + std::move(Range)); + + uint32_t Index = IndexAndList.first; + auto &List = *IndexAndList.second; // Under fission, ranges are specified by constant offsets relative to the // CU's DW_AT_GNU_ranges_base. // FIXME: For DWARF v5, do not generate the DW_AT_ranges attribute under // fission until we support the forms using the .debug_addr section // (DW_RLE_startx_endx etc.). - if (isDwoUnit()) { - if (DD->getDwarfVersion() < 5) - addSectionDelta(ScopeDIE, dwarf::DW_AT_ranges, List.getSym(), - RangeSectionSym); - } else { + if (isDwoUnit()) + addSectionDelta(ScopeDIE, dwarf::DW_AT_ranges, List.getSym(), + RangeSectionSym); + else if (DD->getDwarfVersion() >= 5) + addUInt(ScopeDIE, dwarf::DW_AT_ranges, dwarf::DW_FORM_rnglistx, Index); + else addSectionLabel(ScopeDIE, dwarf::DW_AT_ranges, List.getSym(), RangeSectionSym); - } - - // Add the range list to the set of ranges to be emitted. - (Skeleton ? Skeleton : this)->CURangeLists.push_back(std::move(List)); } void DwarfCompileUnit::attachRangesOrLowHighPC( |