Sink DwarfUnit::LabelBegin down into DwarfCompileUnit since that's the only place...
authorDavid Blaikie <dblaikie@gmail.com>
Sun, 2 Nov 2014 01:21:40 +0000 (01:21 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Sun, 2 Nov 2014 01:21:40 +0000 (01:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221075 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
lib/CodeGen/AsmPrinter/DwarfUnit.cpp
lib/CodeGen/AsmPrinter/DwarfUnit.h

index def0cf78c6c5687946c061cf576e0cb56dca08e7..c9b365c6ce269d93632c95ae577514c528df1f47 100644 (file)
@@ -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<DIE> 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
index 2086c8d84d45173e63b2647e4cb15173dbf61943..065026677d0f042078f8319fce7bb0c4460c6e66 100644 (file)
@@ -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 {
index feb7ffa125a674c0d54d066b9fef8917c39cf067..de43f8f507edf5dce0199e9a0eb641768ae17ac3 100644 (file)
@@ -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(); }