DebugInfo: Remove dead code for accessing fields

Most fields are now accessed via the new debug info hierarchy.  I'll
make the rest of this code dead soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234182 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith
2015-04-06 17:21:05 +00:00
parent e75a8c3855
commit c6370a13cf
3 changed files with 0 additions and 195 deletions

View File

@ -106,56 +106,11 @@ static MDNode *getNodeField(const MDNode *DbgNode, unsigned Elt) {
return dyn_cast_or_null<MDNode>(getField(DbgNode, Elt));
}
static StringRef getStringField(const MDNode *DbgNode, unsigned Elt) {
if (MDString *MDS = dyn_cast_or_null<MDString>(getField(DbgNode, Elt)))
return MDS->getString();
return StringRef();
}
StringRef DIDescriptor::getStringField(unsigned Elt) const {
return ::getStringField(DbgNode, Elt);
}
uint64_t DIDescriptor::getUInt64Field(unsigned Elt) const {
if (auto *C = getConstantField(Elt))
if (ConstantInt *CI = dyn_cast<ConstantInt>(C))
return CI->getZExtValue();
return 0;
}
int64_t DIDescriptor::getInt64Field(unsigned Elt) const {
if (auto *C = getConstantField(Elt))
if (ConstantInt *CI = dyn_cast<ConstantInt>(C))
return CI->getZExtValue();
return 0;
}
DIDescriptor DIDescriptor::getDescriptorField(unsigned Elt) const {
MDNode *Field = getNodeField(DbgNode, Elt);
return DIDescriptor(Field);
}
GlobalVariable *DIDescriptor::getGlobalVariableField(unsigned Elt) const {
return dyn_cast_or_null<GlobalVariable>(getConstantField(Elt));
}
Constant *DIDescriptor::getConstantField(unsigned Elt) const {
if (!DbgNode)
return nullptr;
if (Elt < DbgNode->getNumOperands())
if (auto *C =
dyn_cast_or_null<ConstantAsMetadata>(DbgNode->getOperand(Elt)))
return C->getValue();
return nullptr;
}
Function *DIDescriptor::getFunctionField(unsigned Elt) const {
return dyn_cast_or_null<Function>(getConstantField(Elt));
}
/// \brief Return the size reported by the variable's type.
unsigned DIVariable::getSizeInBits(const DITypeIdentifierMap &Map) {
DIType Ty = getType().resolve(Map);