From bd75475bfcbf81c0f6e3a67511c16704c7da8b7a Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 27 Dec 2013 19:11:52 +0000 Subject: [PATCH] DebugInfo: Remove dead code, DICompositeType::addMember(DIDescriptor D) It's no longer necessary to lazily add members to the DICompositeType member list. Instead any lazy members (special member functions and member template instantiations) are added to the parent late based on their context link, the same way that nested types have always been handled (never being in the member list - just added to the parent DIE lazily based on context). Clang's been updated not to use this function anymore as it improves type unit consistency by never emitting lazy members in type units. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198079 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/DebugInfo.h | 1 - lib/IR/DebugInfo.cpp | 13 ------------- 2 files changed, 14 deletions(-) diff --git a/include/llvm/DebugInfo.h b/include/llvm/DebugInfo.h index 0a56e2f47d9..206f49113e1 100644 --- a/include/llvm/DebugInfo.h +++ b/include/llvm/DebugInfo.h @@ -385,7 +385,6 @@ public: DIArray getTypeArray() const { return getFieldAs(10); } void setTypeArray(DIArray Elements, DIArray TParams = DIArray()); - void addMember(DIDescriptor D); unsigned getRunTimeLang() const { return getUnsignedField(11); } DITypeRef getContainingType() const { return getFieldAs(12); } void setContainingType(DICompositeType ContainingType); diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index ba45e828636..f7215dc51e1 100644 --- a/lib/IR/DebugInfo.cpp +++ b/lib/IR/DebugInfo.cpp @@ -666,19 +666,6 @@ void DICompositeType::setTypeArray(DIArray Elements, DIArray TParams) { DbgNode = N; } -void DICompositeType::addMember(DIDescriptor D) { - SmallVector M; - DIArray OrigM = getTypeArray(); - unsigned Elements = OrigM.getNumElements(); - if (Elements == 1 && !OrigM.getElement(0)) - Elements = 0; - M.reserve(Elements + 1); - for (unsigned i = 0; i != Elements; ++i) - M.push_back(OrigM.getElement(i)); - M.push_back(D); - setTypeArray(DIArray(MDNode::get(DbgNode->getContext(), M))); -} - /// Generate a reference to this DIType. Uses the type identifier instead /// of the actual MDNode if possible, to help type uniquing. DIScopeRef DIScope::getRef() const { -- 2.11.0