From 8d8c981a1f20a5454a4abeffa64942aa0e94d0c5 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Fri, 10 Apr 2015 23:53:44 +0000 Subject: [PATCH] DebugInfo: Remove dead DIDescriptor::getDescriptorField() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234665 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/DebugInfo.h | 11 ----------- lib/IR/DebugInfo.cpp | 19 ------------------- 2 files changed, 30 deletions(-) diff --git a/include/llvm/IR/DebugInfo.h b/include/llvm/IR/DebugInfo.h index 88e81f372fe..7703ad1cfe9 100644 --- a/include/llvm/IR/DebugInfo.h +++ b/include/llvm/IR/DebugInfo.h @@ -63,10 +63,6 @@ typedef DenseMap DITypeIdentifierMap; /// This should not be stored in a container, because the underlying MDNode may /// change in certain situations. class DIDescriptor { - // Befriends DIRef so DIRef can befriend the protected member - // function: getFieldAs. - template friend class DIRef; - public: /// \brief Duplicated debug info flags. /// @@ -80,11 +76,6 @@ public: protected: const MDNode *DbgNode; - DIDescriptor getDescriptorField(unsigned Elt) const; - template DescTy getFieldAs(unsigned Elt) const { - return DescTy(getDescriptorField(Elt)); - } - public: explicit DIDescriptor(const MDNode *N = nullptr) : DbgNode(N) {} DIDescriptor(const DebugNode *N) : DbgNode(N) {} @@ -245,8 +236,6 @@ public: /// /// Abstracts over direct and identifier-based metadata references. template class DIRef { - template - friend DescTy DIDescriptor::getFieldAs(unsigned Elt) const; friend DIScopeRef DIScope::getContext() const; friend DIScopeRef DIScope::getRef() const; friend class DIType; diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index 56db33a63d2..70a67225685 100644 --- a/lib/IR/DebugInfo.cpp +++ b/lib/IR/DebugInfo.cpp @@ -33,25 +33,6 @@ using namespace llvm; using namespace llvm::dwarf; -//===----------------------------------------------------------------------===// -// DIDescriptor -//===----------------------------------------------------------------------===// - -static Metadata *getField(const MDNode *DbgNode, unsigned Elt) { - if (!DbgNode || Elt >= DbgNode->getNumOperands()) - return nullptr; - return DbgNode->getOperand(Elt); -} - -static MDNode *getNodeField(const MDNode *DbgNode, unsigned Elt) { - return dyn_cast_or_null(getField(DbgNode, Elt)); -} - -DIDescriptor DIDescriptor::getDescriptorField(unsigned Elt) const { - MDNode *Field = getNodeField(DbgNode, Elt); - return DIDescriptor(Field); -} - /// \brief Return the size reported by the variable's type. unsigned DIVariable::getSizeInBits(const DITypeIdentifierMap &Map) { DIType Ty = getType().resolve(Map);