summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-06 17:21:05 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-06 17:21:05 +0000
commit398069064dc90cddafc1f51c513d73ee7806beac (patch)
treec0bf4421656504cc0965652b57ef985afbe13017 /llvm/lib/IR/DebugInfo.cpp
parent5342c6ceabcab054996da95071effef8dac64ee3 (diff)
downloadbcm5719-llvm-398069064dc90cddafc1f51c513d73ee7806beac.tar.gz
bcm5719-llvm-398069064dc90cddafc1f51c513d73ee7806beac.zip
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. llvm-svn: 234182
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp45
1 files changed, 0 insertions, 45 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 70025c77518..2f497e9dc11 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -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);
OpenPOWER on IntegriCloud