summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-08-02 20:54:50 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-08-02 20:54:50 +0000
commitb0dbe526fccf3e0c7edcb655ea66e9378cc5b4a6 (patch)
treed1ac2e5fc9f760911b02240d71ab87b8665a49a9
parentaf9bb0f37ea606491f09c9ab05064bf7e1bda0f3 (diff)
downloadbcm5719-llvm-b0dbe526fccf3e0c7edcb655ea66e9378cc5b4a6.tar.gz
bcm5719-llvm-b0dbe526fccf3e0c7edcb655ea66e9378cc5b4a6.zip
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. llvm-svn: 243858
-rw-r--r--llvm/include/llvm/CodeGen/DIE.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/llvm/include/llvm/CodeGen/DIE.h b/llvm/include/llvm/CodeGen/DIE.h
index ccfbee6ef2a..2e6d4aa6d19 100644
--- a/llvm/include/llvm/CodeGen/DIE.h
+++ b/llvm/include/llvm/CodeGen/DIE.h
@@ -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:
OpenPOWER on IntegriCloud