From b2251b3e32310e0b0863e849a75fd537d2e750d7 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 14 Dec 2018 22:34:03 +0000 Subject: [PATCH] DebugInfo: Move addAddrBase from DwarfUnit to DwarfCompileUnit Only CUs need an address table reference. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349203 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 9 +++++++++ lib/CodeGen/AsmPrinter/DwarfCompileUnit.h | 3 +++ lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 9 --------- lib/CodeGen/AsmPrinter/DwarfUnit.h | 3 --- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index d93c7f6c845..1dca3f0fce5 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -1125,3 +1125,12 @@ bool DwarfCompileUnit::includeMinimalInlineScopes() const { return getCUNode()->getEmissionKind() == DICompileUnit::LineTablesOnly || (DD->useSplitDwarf() && !Skeleton); } + +void DwarfCompileUnit::addAddrTableBase() { + const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering(); + MCSymbol *Label = DD->getAddressPool().getLabel(); + addSectionLabel(getUnitDie(), + getDwarfVersion() >= 5 ? dwarf::DW_AT_addr_base + : dwarf::DW_AT_GNU_addr_base, + Label, TLOF.getDwarfAddrSection()->getBeginSymbol()); +} diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h index 13679c37fe5..6e9490702c8 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h @@ -243,6 +243,9 @@ public: void emitHeader(bool UseOffsets) override; + /// Add the DW_AT_addr_base attribute to the unit DIE. + void addAddrTableBase(); + MCSymbol *getLabelBegin() const { assert(getSection()); return LabelBegin; diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index 2053395808f..062eb3a8892 100644 --- a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -1664,12 +1664,3 @@ void DwarfUnit::addLoclistsBase() { DU->getLoclistsTableBaseSym(), TLOF.getDwarfLoclistsSection()->getBeginSymbol()); } - -void DwarfUnit::addAddrTableBase() { - const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering(); - MCSymbol *Label = DD->getAddressPool().getLabel(); - addSectionLabel(getUnitDie(), - getDwarfVersion() >= 5 ? dwarf::DW_AT_addr_base - : dwarf::DW_AT_GNU_addr_base, - Label, TLOF.getDwarfAddrSection()->getBeginSymbol()); -} diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.h b/lib/CodeGen/AsmPrinter/DwarfUnit.h index 860d1653184..c5cb7e1bc33 100644 --- a/lib/CodeGen/AsmPrinter/DwarfUnit.h +++ b/lib/CodeGen/AsmPrinter/DwarfUnit.h @@ -275,9 +275,6 @@ public: /// Add the DW_AT_loclists_base attribute to the unit DIE. void addLoclistsBase(); - /// Add the DW_AT_addr_base attribute to the unit DIE. - void addAddrTableBase(); - virtual DwarfCompileUnit &getCU() = 0; void constructTypeDIE(DIE &Buffer, const DICompositeType *CTy); -- 2.50.1