From: David Blaikie Date: Thu, 1 Dec 2016 21:59:09 +0000 (+0000) Subject: [debug info] Minor cleanup from D27170/r288399 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e348b776d16ae2ed49e09fec12610fb2e1b8186b;p=llvm [debug info] Minor cleanup from D27170/r288399 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288421 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/CodeGen/DIE.h b/include/llvm/CodeGen/DIE.h index 341c07f73dd..6872f77c191 100644 --- a/include/llvm/CodeGen/DIE.h +++ b/include/llvm/CodeGen/DIE.h @@ -619,10 +619,6 @@ class DIE : IntrusiveBackListNode, public DIEValueList { DIE() = delete; explicit DIE(dwarf::Tag Tag) : Offset(0), Size(0), Tag(Tag) {} -protected: - void setUnit(DIEUnit *U) { - Owner = U; - } public: static DIE *get(BumpPtrAllocator &Alloc, dwarf::Tag Tag) { return new (Alloc) DIE(Tag); @@ -706,7 +702,6 @@ public: //===--------------------------------------------------------------------===// /// Represents a compile or type unit. class DIEUnit { -protected: /// The compile unit or type unit DIE. This variable must be an instance of /// DIE so that we can calculate the DIEUnit from any DIE by traversing the /// parent backchain and getting the Unit DIE, and then casting itself to a diff --git a/lib/CodeGen/AsmPrinter/DIE.cpp b/lib/CodeGen/AsmPrinter/DIE.cpp index ef1e41f4e3d..06023fcc51b 100644 --- a/lib/CodeGen/AsmPrinter/DIE.cpp +++ b/lib/CodeGen/AsmPrinter/DIE.cpp @@ -202,7 +202,7 @@ DIEUnit::DIEUnit(uint16_t V, uint8_t A, dwarf::Tag UnitTag) : Die(UnitTag), Section(nullptr), Offset(0), Length(0), Version(V), AddrSize(A) { - Die.setUnit(this); + Die.Owner = this; assert((UnitTag == dwarf::DW_TAG_compile_unit || UnitTag == dwarf::DW_TAG_type_unit || UnitTag == dwarf::DW_TAG_partial_unit) && "expected a unit TAG"); diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h index b1f818bfd67..9412e50884e 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h @@ -194,7 +194,7 @@ public: void emitHeader(bool UseOffsets) override; MCSymbol *getLabelBegin() const { - assert(Section); + assert(getSection()); return LabelBegin; } diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.h b/lib/CodeGen/AsmPrinter/DwarfUnit.h index 6d045eabe44..f365930b603 100644 --- a/lib/CodeGen/AsmPrinter/DwarfUnit.h +++ b/lib/CodeGen/AsmPrinter/DwarfUnit.h @@ -112,7 +112,7 @@ public: const DICompileUnit *getCUNode() const { return CUNode; } /// Return true if this compile unit has something to write out. - bool hasContent() const { return Die.hasChildren(); } + bool hasContent() const { return getUnitDie().hasChildren(); } /// Get string containing language specific context for a global name. ///