From 5bb95798bcec333e0540e762bfc8b5b7af83dbb2 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Sun, 2 Aug 2015 20:54:50 +0000 Subject: [PATCH] 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 --- include/llvm/CodeGen/DIE.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/include/llvm/CodeGen/DIE.h b/include/llvm/CodeGen/DIE.h index ccfbee6ef2a..2e6d4aa6d19 100644 --- a/include/llvm/CodeGen/DIE.h +++ b/include/llvm/CodeGen/DIE.h @@ -630,7 +630,6 @@ public: class DIE : IntrusiveBackListNode, public DIEValueList { friend class IntrusiveBackList; -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: