mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-04 06:09:05 +00:00
DebugInfo: Move DIDerivedType accessors to MDDerivedType, NFC
Add accessors in `MDDerivedType` to downcast `getExtraData()`, matching those in `DIDerivedType`. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234816 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f265d42389
commit
8ae5482d49
@ -315,22 +315,15 @@ public:
|
||||
|
||||
/// \brief Return property node, if this ivar is associated with one.
|
||||
MDObjCProperty *getObjCProperty() const {
|
||||
return dyn_cast_or_null<MDObjCProperty>(
|
||||
cast<MDDerivedType>(get())->getExtraData());
|
||||
return cast<MDDerivedType>(get())->getObjCProperty();
|
||||
}
|
||||
|
||||
DITypeRef getClassType() const {
|
||||
assert(getTag() == dwarf::DW_TAG_ptr_to_member_type);
|
||||
return MDTypeRef(cast<MDDerivedType>(get())->getExtraData());
|
||||
return cast<MDDerivedType>(get())->getClassType();
|
||||
}
|
||||
|
||||
Constant *getConstant() const {
|
||||
assert(getTag() == dwarf::DW_TAG_member && isStaticMember());
|
||||
if (auto *C = cast_or_null<ConstantAsMetadata>(
|
||||
cast<MDDerivedType>(get())->getExtraData()))
|
||||
return C->getValue();
|
||||
|
||||
return nullptr;
|
||||
return cast<MDDerivedType>(get())->getConstant();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -746,6 +746,23 @@ public:
|
||||
Metadata *getExtraData() const { return getRawExtraData(); }
|
||||
Metadata *getRawExtraData() const { return getOperand(4); }
|
||||
|
||||
/// \brief Get casted version of extra data.
|
||||
/// @{
|
||||
MDTypeRef getClassType() const {
|
||||
assert(getTag() == dwarf::DW_TAG_ptr_to_member_type);
|
||||
return MDTypeRef(getExtraData());
|
||||
}
|
||||
MDObjCProperty *getObjCProperty() const {
|
||||
return dyn_cast_or_null<MDObjCProperty>(getExtraData());
|
||||
}
|
||||
Constant *getConstant() const {
|
||||
assert(getTag() == dwarf::DW_TAG_member && isStaticMember());
|
||||
if (auto *C = cast_or_null<ConstantAsMetadata>(getExtraData()))
|
||||
return C->getValue();
|
||||
return nullptr;
|
||||
}
|
||||
/// @}
|
||||
|
||||
static bool classof(const Metadata *MD) {
|
||||
return MD->getMetadataID() == MDDerivedTypeKind;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user