mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
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:
@ -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);
|
||||
|
Reference in New Issue
Block a user