AsmPrinter: Stop inheriting from DIE

Change `DIELoc` and `DIEBlock` to stop inheriting from `DIE`, instead
inheriting from `DIEValueList` to share the value storage API.  This
awkward bit of code-sharing was also fairly confusing: neither `DIELoc`
nor `DIEBlock` represents a `DIE`, so why would they inherit from it?

Aside from the API cleanup, this should improve debug info memory usage
in the backend, since it shaves five pointers off of every `DIELoc` and
`DIEBlock`.  I haven't bothered to measure the savings, though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243858 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith 2015-08-02 20:54:50 +00:00
parent 401c02a7ed
commit 5bb95798bc
1 changed files with 3 additions and 7 deletions

View File

@ -630,7 +630,6 @@ public:
class DIE : IntrusiveBackListNode, public DIEValueList {
friend class IntrusiveBackList<DIE>;
protected:
/// Offset - Offset in debug info section.
///
unsigned Offset;
@ -650,10 +649,7 @@ protected:
DIE *Parent = nullptr;
protected:
DIE() : Offset(0), Size(0) {}
private:
DIE() = delete;
explicit DIE(dwarf::Tag Tag) : Offset(0), Size(0), Tag(Tag) {}
public:
@ -723,7 +719,7 @@ public:
//===--------------------------------------------------------------------===//
/// DIELoc - Represents an expression location.
//
class DIELoc : public DIE {
class DIELoc : public DIEValueList {
mutable unsigned Size; // Size in bytes excluding size header.
public:
@ -759,7 +755,7 @@ public:
//===--------------------------------------------------------------------===//
/// DIEBlock - Represents a block of values.
//
class DIEBlock : public DIE {
class DIEBlock : public DIEValueList {
mutable unsigned Size; // Size in bytes excluding size header.
public: