From f4bdc31271977a9feaed4eb0d5aa413fbd2447ca Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Sun, 2 Nov 2014 01:21:40 +0000 Subject: [PATCH] Sink DwarfUnit::LabelBegin down into DwarfCompileUnit since that's the only place it's needed. llvm-svn: 221075 --- llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h | 10 ++++++++++ llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 2 -- llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h | 8 -------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h index def0cf7..c9b365c 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h @@ -39,6 +39,9 @@ class DwarfCompileUnit : public DwarfUnit { /// A label at the start of the non-dwo section related to this unit. MCSymbol *SectionSym; + /// The start of the unit within its section. + MCSymbol *LabelBegin; + /// \brief Construct a DIE for the given DbgVariable without initializing the /// DbgVariable's DIE reference. std::unique_ptr constructVariableDIEImpl(const DbgVariable &DV, @@ -171,6 +174,8 @@ public: void initSection(const MCSection *Section, MCSymbol *SectionSym) { DwarfUnit::initSection(Section); this->SectionSym = SectionSym; + LabelBegin = + Asm->GetTempSymbol(Section->getLabelBeginName(), getUniqueID()); } unsigned getLength() { @@ -179,6 +184,11 @@ public: } void emitHeader(const MCSymbol *ASectionSym) const override; + + MCSymbol *getLabelBegin() const { + assert(Section); + return LabelBegin; + } }; } // end llvm namespace diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index 2086c8d..0650266 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -1752,8 +1752,6 @@ void DwarfUnit::emitHeader(const MCSymbol *ASectionSym) const { void DwarfUnit::initSection(const MCSection *Section) { assert(!this->Section); this->Section = Section; - this->LabelBegin = - Asm->GetTempSymbol(Section->getLabelBeginName(), getUniqueID()); } void DwarfTypeUnit::emitHeader(const MCSymbol *ASectionSym) const { diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h index feb7ffa..de43f8f 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h @@ -129,9 +129,6 @@ protected: /// The section this unit will be emitted in. const MCSection *Section; - /// The start of the unit within its section. - MCSymbol *LabelBegin; - DwarfUnit(unsigned UID, dwarf::Tag, DICompileUnit CU, AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU); @@ -144,11 +141,6 @@ public: return Section; } - MCSymbol *getLabelBegin() const { - assert(Section); - return LabelBegin; - } - // Accessors. unsigned getUniqueID() const { return UniqueID; } uint16_t getLanguage() const { return CUNode.getLanguage(); } -- 2.7.4