mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-19 17:24:57 +00:00
DebugInfo: Make DIDerivedType accessors more strict
These accessors in `DIDerivedType` should only be called when `DbgNode` really is a `MDDerivedType`, not just a `MDDerivedTypeBase`. Assume that it is. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234812 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -314,23 +314,20 @@ public:
|
|||||||
DITypeRef getTypeDerivedFrom() const { return get()->getBaseType(); }
|
DITypeRef getTypeDerivedFrom() const { return get()->getBaseType(); }
|
||||||
|
|
||||||
/// \brief Return property node, if this ivar is associated with one.
|
/// \brief Return property node, if this ivar is associated with one.
|
||||||
MDNode *getObjCProperty() const {
|
MDObjCProperty *getObjCProperty() const {
|
||||||
if (auto *N = dyn_cast<MDDerivedType>(get()))
|
return dyn_cast_or_null<MDObjCProperty>(
|
||||||
return dyn_cast_or_null<MDNode>(N->getExtraData());
|
cast<MDDerivedType>(get())->getExtraData());
|
||||||
return nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DITypeRef getClassType() const {
|
DITypeRef getClassType() const {
|
||||||
assert(getTag() == dwarf::DW_TAG_ptr_to_member_type);
|
assert(getTag() == dwarf::DW_TAG_ptr_to_member_type);
|
||||||
if (auto *N = dyn_cast<MDDerivedType>(get()))
|
return MDTypeRef(cast<MDDerivedType>(get())->getExtraData());
|
||||||
return MDTypeRef(N->getExtraData());
|
|
||||||
return MDTypeRef();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Constant *getConstant() const {
|
Constant *getConstant() const {
|
||||||
assert((getTag() == dwarf::DW_TAG_member) && isStaticMember());
|
assert(getTag() == dwarf::DW_TAG_member && isStaticMember());
|
||||||
if (auto *N = dyn_cast<MDDerivedType>(get()))
|
if (auto *C = cast_or_null<ConstantAsMetadata>(
|
||||||
if (auto *C = dyn_cast_or_null<ConstantAsMetadata>(N->getExtraData()))
|
cast<MDDerivedType>(get())->getExtraData()))
|
||||||
return C->getValue();
|
return C->getValue();
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
Reference in New Issue
Block a user