DebugInfo: Remove dead code, DICompositeType::addMember(DIDescriptor D)
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 27 Dec 2013 19:11:52 +0000 (19:11 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 27 Dec 2013 19:11:52 +0000 (19:11 +0000)
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
lib/IR/DebugInfo.cpp

index 0a56e2f47d9201f0f34bfe3da4779d4129bd133f..206f49113e148d66cf20f5bcefc7c2a868cf1c62 100644 (file)
@@ -385,7 +385,6 @@ public:
 
   DIArray getTypeArray() const { return getFieldAs<DIArray>(10); }
   void setTypeArray(DIArray Elements, DIArray TParams = DIArray());
-  void addMember(DIDescriptor D);
   unsigned getRunTimeLang() const { return getUnsignedField(11); }
   DITypeRef getContainingType() const { return getFieldAs<DITypeRef>(12); }
   void setContainingType(DICompositeType ContainingType);
index ba45e828636f87d5de6b6d49bb9a62ca48b90e4a..f7215dc51e1e2d996739c6617f15b4a01b0585e7 100644 (file)
@@ -666,19 +666,6 @@ void DICompositeType::setTypeArray(DIArray Elements, DIArray TParams) {
   DbgNode = N;
 }
 
-void DICompositeType::addMember(DIDescriptor D) {
-  SmallVector<llvm::Value *, 16> 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 {