summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2019-10-11 23:51:24 +0000
committerDavid Blaikie <dblaikie@gmail.com>2019-10-11 23:51:24 +0000
commitde9aa37bf061abce87d0fbca68959a79e0cc7c51 (patch)
tree33093e047f5940c0436d802bf21148bd1a102813 /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
parentcde860a1c996b0badff5f8f10baf48df3c19d921 (diff)
downloadbcm5719-llvm-de9aa37bf061abce87d0fbca68959a79e0cc7c51.tar.gz
bcm5719-llvm-de9aa37bf061abce87d0fbca68959a79e0cc7c51.zip
DebugInfo: Reduce the scope of some variables related to debug_ranges emission
Minor tidy up/NFC llvm-svn: 374613
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index 69c4d3fb5b4..d284d4ffa44 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -467,14 +467,6 @@ void DwarfCompileUnit::constructScopeDIE(
void DwarfCompileUnit::addScopeRangeList(DIE &ScopeDIE,
SmallVector<RangeSpan, 2> Range) {
- const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
-
- // Emit the offset into .debug_ranges or .debug_rnglists as a relocatable
- // label. emitDIE() will handle emitting it appropriately.
- const MCSymbol *RangeSectionSym =
- DD->getDwarfVersion() >= 5
- ? TLOF.getDwarfRnglistsSection()->getBeginSymbol()
- : TLOF.getDwarfRangesSection()->getBeginSymbol();
HasRangeLists = true;
@@ -493,12 +485,17 @@ void DwarfCompileUnit::addScopeRangeList(DIE &ScopeDIE,
// (DW_RLE_startx_endx etc.).
if (DD->getDwarfVersion() >= 5)
addUInt(ScopeDIE, dwarf::DW_AT_ranges, dwarf::DW_FORM_rnglistx, Index);
- else if (isDwoUnit())
- addSectionDelta(ScopeDIE, dwarf::DW_AT_ranges, List.getSym(),
- RangeSectionSym);
- else
- addSectionLabel(ScopeDIE, dwarf::DW_AT_ranges, List.getSym(),
- RangeSectionSym);
+ else {
+ const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
+ const MCSymbol *RangeSectionSym =
+ TLOF.getDwarfRangesSection()->getBeginSymbol();
+ if (isDwoUnit())
+ addSectionDelta(ScopeDIE, dwarf::DW_AT_ranges, List.getSym(),
+ RangeSectionSym);
+ else
+ addSectionLabel(ScopeDIE, dwarf::DW_AT_ranges, List.getSym(),
+ RangeSectionSym);
+ }
}
void DwarfCompileUnit::attachRangesOrLowHighPC(
OpenPOWER on IntegriCloud