[llvm] r198830 - DwarfUnit: Move the DICompileUnit Node to the DwarfCompileUnit only

David Blaikie dblaikie at gmail.com
Wed Jan 8 17:20:14 PST 2014


Author: dblaikie
Date: Wed Jan  8 19:20:14 2014
New Revision: 198830

URL: http://llvm.org/viewvc/llvm-project?rev=198830&view=rev
Log:
DwarfUnit: Move the DICompileUnit Node to the DwarfCompileUnit only

It's unused in DwarfTypeUnit, as is expected.

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

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp?rev=198830&r1=198829&r2=198830&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Wed Jan  8 19:20:14 2014
@@ -40,23 +40,23 @@ GenerateDwarfTypeUnits("generate-type-un
                        cl::init(false));
 
 /// Unit - Unit constructor.
-DwarfUnit::DwarfUnit(unsigned UID, DIE *D, DICompileUnit Node, AsmPrinter *A,
-                     DwarfDebug *DW, DwarfFile *DWU)
-    : UniqueID(UID), Node(Node), UnitDie(D), DebugInfoOffset(0), Asm(A), DD(DW),
-      DU(DWU), IndexTyDie(0), Section(0), Skeleton(0) {
+DwarfUnit::DwarfUnit(unsigned UID, DIE *D, AsmPrinter *A, DwarfDebug *DW,
+                     DwarfFile *DWU)
+    : UniqueID(UID), UnitDie(D), DebugInfoOffset(0), Asm(A), DD(DW), DU(DWU),
+      IndexTyDie(0), Section(0), Skeleton(0) {
   DIEIntegerOne = new (DIEValueAllocator) DIEInteger(1);
 }
 
 DwarfCompileUnit::DwarfCompileUnit(unsigned UID, DIE *D, DICompileUnit Node,
                                    AsmPrinter *A, DwarfDebug *DW,
                                    DwarfFile *DWU)
-    : DwarfUnit(UID, D, Node, A, DW, DWU) {
+    : DwarfUnit(UID, D, A, DW, DWU), Node(Node) {
   insertDIE(Node, D);
 }
 
 DwarfTypeUnit::DwarfTypeUnit(unsigned UID, DIE *D, uint16_t Language,
                              AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU)
-    : DwarfUnit(UID, D, DICompileUnit(), A, DW, DWU), Language(Language) {}
+    : DwarfUnit(UID, D, A, DW, DWU), Language(Language) {}
 
 /// ~Unit - Destructor for compile unit.
 DwarfUnit::~DwarfUnit() {

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h?rev=198830&r1=198829&r2=198830&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h Wed Jan  8 19:20:14 2014
@@ -65,9 +65,6 @@ protected:
   /// UniqueID - a numeric ID unique among all CUs in the module
   unsigned UniqueID;
 
-  /// Node - MDNode for the compile unit.
-  DICompileUnit Node;
-
   /// Unit debug information entry.
   const OwningPtr<DIE> UnitDie;
 
@@ -149,8 +146,8 @@ protected:
   /// Skeleton unit associated with this unit.
   DwarfUnit *Skeleton;
 
-  DwarfUnit(unsigned UID, DIE *D, DICompileUnit CU, AsmPrinter *A,
-            DwarfDebug *DW, DwarfFile *DWU);
+  DwarfUnit(unsigned UID, DIE *D, AsmPrinter *A, DwarfDebug *DW,
+            DwarfFile *DWU);
 
 public:
   virtual ~DwarfUnit();
@@ -219,7 +216,6 @@ public:
   // Accessors.
   unsigned getUniqueID() const { return UniqueID; }
   virtual uint16_t getLanguage() const = 0;
-  DICompileUnit getNode() const { return Node; }
   DIE *getUnitDie() const { return UnitDie.get(); }
   const StringMap<const DIE *> &getGlobalNames() const { return GlobalNames; }
   const StringMap<const DIE *> &getGlobalTypes() const { return GlobalTypes; }
@@ -534,9 +530,13 @@ private:
 };
 
 class DwarfCompileUnit : public DwarfUnit {
+  /// Node - MDNode for the compile unit.
+  DICompileUnit Node;
+
 public:
   DwarfCompileUnit(unsigned UID, DIE *D, DICompileUnit Node, AsmPrinter *A,
                    DwarfDebug *DW, DwarfFile *DWU);
+  DICompileUnit getNode() const { return Node; }
   virtual ~DwarfCompileUnit() LLVM_OVERRIDE;
 
   /// createGlobalVariableDIE - create global variable DIE.





More information about the llvm-commits mailing list