diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-10-09 00:11:39 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-10-09 00:11:39 +0000 |
commit | 524002004db54bbc504c3286c6ee649ba441e2f4 (patch) | |
tree | 69f432390157a35422d007c67a14d00af91713ff /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | b3f97ba815b8ccb794aa3836cfd135feb9d43da7 (diff) | |
download | bcm5719-llvm-524002004db54bbc504c3286c6ee649ba441e2f4.tar.gz bcm5719-llvm-524002004db54bbc504c3286c6ee649ba441e2f4.zip |
Sink DwarfDebug::addScopeRangeList down into DwarfCompileUnit
(& add a few accessors/make a couple of things public for this - it's a
bit of a toss-up, but I think I prefer it this way, keeping some more of
the meaty code down in DwarfCompileUnit - if only to make for smaller
implementation files, etc)
I think we could simplify range handling a bit if we removed the range
lists from each unit and just put a single range list on DwarfDebug,
similar to address pooling.
llvm-svn: 219370
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 2f61f500385..4d60259861c 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -330,31 +330,6 @@ bool DwarfDebug::isLexicalScopeDIENull(LexicalScope *Scope) { return !getLabelAfterInsn(Ranges.front().second); } -void DwarfDebug::addScopeRangeList(DwarfCompileUnit &TheCU, DIE &ScopeDIE, - const SmallVectorImpl<InsnRange> &Range) { - // Emit offset in .debug_range as a relocatable label. emitDIE will handle - // emitting it appropriately. - MCSymbol *RangeSym = Asm->GetTempSymbol("debug_ranges", GlobalRangeCount++); - - // Under fission, ranges are specified by constant offsets relative to the - // CU's DW_AT_GNU_ranges_base. - if (useSplitDwarf()) - TheCU.addSectionDelta(ScopeDIE, dwarf::DW_AT_ranges, RangeSym, - DwarfDebugRangeSectionSym); - else - TheCU.addSectionLabel(ScopeDIE, dwarf::DW_AT_ranges, RangeSym, - DwarfDebugRangeSectionSym); - - RangeSpanList List(RangeSym); - for (const InsnRange &R : Range) { - RangeSpan Span(getLabelBeforeInsn(R.first), getLabelAfterInsn(R.second)); - List.addRange(std::move(Span)); - } - - // Add the range list to the set of ranges to be emitted. - TheCU.addRangeList(std::move(List)); -} - void DwarfDebug::attachRangesOrLowHighPC(DwarfCompileUnit &TheCU, DIE &Die, const SmallVectorImpl<InsnRange> &Ranges) { assert(!Ranges.empty()); @@ -362,7 +337,7 @@ void DwarfDebug::attachRangesOrLowHighPC(DwarfCompileUnit &TheCU, DIE &Die, TheCU.attachLowHighPC(Die, getLabelBeforeInsn(Ranges.front().first), getLabelAfterInsn(Ranges.front().second)); else - addScopeRangeList(TheCU, Die, Ranges); + TheCU.addScopeRangeList(Die, Ranges); } // Construct new DW_TAG_lexical_block for this scope and attach |