Revert "DwarfUnit: Move the DICompileUnit Node to the DwarfCompileUnit only"

This reverts commit r198830.

Decided to go a different way with this...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198841 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2014-01-09 03:03:27 +00:00
parent 41d9e92ec0
commit 75a032dc00
2 changed files with 12 additions and 12 deletions

View File

@ -40,23 +40,23 @@ GenerateDwarfTypeUnits("generate-type-units", cl::Hidden,
cl::init(false)); cl::init(false));
/// Unit - Unit constructor. /// Unit - Unit constructor.
DwarfUnit::DwarfUnit(unsigned UID, DIE *D, AsmPrinter *A, DwarfDebug *DW, DwarfUnit::DwarfUnit(unsigned UID, DIE *D, DICompileUnit Node, AsmPrinter *A,
DwarfFile *DWU) DwarfDebug *DW, DwarfFile *DWU)
: UniqueID(UID), UnitDie(D), DebugInfoOffset(0), Asm(A), DD(DW), DU(DWU), : UniqueID(UID), Node(Node), UnitDie(D), DebugInfoOffset(0), Asm(A), DD(DW),
IndexTyDie(0), Section(0), Skeleton(0) { DU(DWU), IndexTyDie(0), Section(0), Skeleton(0) {
DIEIntegerOne = new (DIEValueAllocator) DIEInteger(1); DIEIntegerOne = new (DIEValueAllocator) DIEInteger(1);
} }
DwarfCompileUnit::DwarfCompileUnit(unsigned UID, DIE *D, DICompileUnit Node, DwarfCompileUnit::DwarfCompileUnit(unsigned UID, DIE *D, DICompileUnit Node,
AsmPrinter *A, DwarfDebug *DW, AsmPrinter *A, DwarfDebug *DW,
DwarfFile *DWU) DwarfFile *DWU)
: DwarfUnit(UID, D, A, DW, DWU), Node(Node) { : DwarfUnit(UID, D, Node, A, DW, DWU) {
insertDIE(Node, D); insertDIE(Node, D);
} }
DwarfTypeUnit::DwarfTypeUnit(unsigned UID, DIE *D, uint16_t Language, DwarfTypeUnit::DwarfTypeUnit(unsigned UID, DIE *D, uint16_t Language,
AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU) AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU)
: DwarfUnit(UID, D, A, DW, DWU), Language(Language) {} : DwarfUnit(UID, D, DICompileUnit(), A, DW, DWU), Language(Language) {}
/// ~Unit - Destructor for compile unit. /// ~Unit - Destructor for compile unit.
DwarfUnit::~DwarfUnit() { DwarfUnit::~DwarfUnit() {

View File

@ -65,6 +65,9 @@ protected:
/// UniqueID - a numeric ID unique among all CUs in the module /// UniqueID - a numeric ID unique among all CUs in the module
unsigned UniqueID; unsigned UniqueID;
/// Node - MDNode for the compile unit.
DICompileUnit Node;
/// Unit debug information entry. /// Unit debug information entry.
const OwningPtr<DIE> UnitDie; const OwningPtr<DIE> UnitDie;
@ -146,8 +149,8 @@ protected:
/// Skeleton unit associated with this unit. /// Skeleton unit associated with this unit.
DwarfUnit *Skeleton; DwarfUnit *Skeleton;
DwarfUnit(unsigned UID, DIE *D, AsmPrinter *A, DwarfDebug *DW, DwarfUnit(unsigned UID, DIE *D, DICompileUnit CU, AsmPrinter *A,
DwarfFile *DWU); DwarfDebug *DW, DwarfFile *DWU);
public: public:
virtual ~DwarfUnit(); virtual ~DwarfUnit();
@ -216,6 +219,7 @@ public:
// Accessors. // Accessors.
unsigned getUniqueID() const { return UniqueID; } unsigned getUniqueID() const { return UniqueID; }
virtual uint16_t getLanguage() const = 0; virtual uint16_t getLanguage() const = 0;
DICompileUnit getNode() const { return Node; }
DIE *getUnitDie() const { return UnitDie.get(); } DIE *getUnitDie() const { return UnitDie.get(); }
const StringMap<const DIE *> &getGlobalNames() const { return GlobalNames; } const StringMap<const DIE *> &getGlobalNames() const { return GlobalNames; }
const StringMap<const DIE *> &getGlobalTypes() const { return GlobalTypes; } const StringMap<const DIE *> &getGlobalTypes() const { return GlobalTypes; }
@ -530,13 +534,9 @@ private:
}; };
class DwarfCompileUnit : public DwarfUnit { class DwarfCompileUnit : public DwarfUnit {
/// Node - MDNode for the compile unit.
DICompileUnit Node;
public: public:
DwarfCompileUnit(unsigned UID, DIE *D, DICompileUnit Node, AsmPrinter *A, DwarfCompileUnit(unsigned UID, DIE *D, DICompileUnit Node, AsmPrinter *A,
DwarfDebug *DW, DwarfFile *DWU); DwarfDebug *DW, DwarfFile *DWU);
DICompileUnit getNode() const { return Node; }
virtual ~DwarfCompileUnit() LLVM_OVERRIDE; virtual ~DwarfCompileUnit() LLVM_OVERRIDE;
/// createGlobalVariableDIE - create global variable DIE. /// createGlobalVariableDIE - create global variable DIE.