[llvm] r288421 - [debug info] Minor cleanup from D27170/r288399

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 1 13:59:09 PST 2016


Author: dblaikie
Date: Thu Dec  1 15:59:09 2016
New Revision: 288421

URL: http://llvm.org/viewvc/llvm-project?rev=288421&view=rev
Log:
[debug info] Minor cleanup from D27170/r288399

Modified:
    llvm/trunk/include/llvm/CodeGen/DIE.h
    llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h

Modified: llvm/trunk/include/llvm/CodeGen/DIE.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/DIE.h?rev=288421&r1=288420&r2=288421&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/DIE.h (original)
+++ llvm/trunk/include/llvm/CodeGen/DIE.h Thu Dec  1 15:59:09 2016
@@ -619,10 +619,6 @@ class DIE : IntrusiveBackListNode, publi
   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

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp?rev=288421&r1=288420&r2=288421&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp Thu Dec  1 15:59:09 2016
@@ -202,7 +202,7 @@ DIEUnit::DIEUnit(uint16_t V, uint8_t A,
     : 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");

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h?rev=288421&r1=288420&r2=288421&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h Thu Dec  1 15:59:09 2016
@@ -194,7 +194,7 @@ public:
   void emitHeader(bool UseOffsets) override;
 
   MCSymbol *getLabelBegin() const {
-    assert(Section);
+    assert(getSection());
     return LabelBegin;
   }
 

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h?rev=288421&r1=288420&r2=288421&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h Thu Dec  1 15:59:09 2016
@@ -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.
   ///




More information about the llvm-commits mailing list