DebugInfo: Remove dead DIDescriptor::getDescriptorField()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234665 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith 2015-04-10 23:53:44 +00:00
parent b26cf11a7b
commit 8d8c981a1f
2 changed files with 0 additions and 30 deletions

View File

@ -63,10 +63,6 @@ typedef DenseMap<const MDString *, MDNode *> DITypeIdentifierMap;
/// This should not be stored in a container, because the underlying MDNode may /// This should not be stored in a container, because the underlying MDNode may
/// change in certain situations. /// change in certain situations.
class DIDescriptor { class DIDescriptor {
// Befriends DIRef so DIRef can befriend the protected member
// function: getFieldAs<DIRef>.
template <typename T> friend class DIRef;
public: public:
/// \brief Duplicated debug info flags. /// \brief Duplicated debug info flags.
/// ///
@ -80,11 +76,6 @@ public:
protected: protected:
const MDNode *DbgNode; const MDNode *DbgNode;
DIDescriptor getDescriptorField(unsigned Elt) const;
template <typename DescTy> DescTy getFieldAs(unsigned Elt) const {
return DescTy(getDescriptorField(Elt));
}
public: public:
explicit DIDescriptor(const MDNode *N = nullptr) : DbgNode(N) {} explicit DIDescriptor(const MDNode *N = nullptr) : DbgNode(N) {}
DIDescriptor(const DebugNode *N) : DbgNode(N) {} DIDescriptor(const DebugNode *N) : DbgNode(N) {}
@ -245,8 +236,6 @@ public:
/// ///
/// Abstracts over direct and identifier-based metadata references. /// Abstracts over direct and identifier-based metadata references.
template <typename T> class DIRef { template <typename T> class DIRef {
template <typename DescTy>
friend DescTy DIDescriptor::getFieldAs(unsigned Elt) const;
friend DIScopeRef DIScope::getContext() const; friend DIScopeRef DIScope::getContext() const;
friend DIScopeRef DIScope::getRef() const; friend DIScopeRef DIScope::getRef() const;
friend class DIType; friend class DIType;

View File

@ -33,25 +33,6 @@
using namespace llvm; using namespace llvm;
using namespace llvm::dwarf; 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<MDNode>(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. /// \brief Return the size reported by the variable's type.
unsigned DIVariable::getSizeInBits(const DITypeIdentifierMap &Map) { unsigned DIVariable::getSizeInBits(const DITypeIdentifierMap &Map) {
DIType Ty = getType().resolve(Map); DIType Ty = getType().resolve(Map);