If a type is derived from a derived type then calculate size appropriately.

llvm-svn: 85619
This commit is contained in:
Devang Patel 2009-10-30 22:09:30 +00:00
parent 5c2040b182
commit 13cb281013
1 changed files with 3 additions and 3 deletions

View File

@ -398,10 +398,10 @@ bool DIVariable::Verify() const {
/// getOriginalTypeSize - If this type is derived from a base type then
/// return base type size.
uint64_t DIDerivedType::getOriginalTypeSize() const {
if (getTag() != dwarf::DW_TAG_member)
return getSizeInBits();
DIType BT = getTypeDerivedFrom();
if (BT.getTag() != dwarf::DW_TAG_base_type)
if (!BT.isNull() && BT.isDerivedType())
return DIDerivedType(BT.getNode()).getOriginalTypeSize();
if (BT.isNull())
return getSizeInBits();
return BT.getSizeInBits();
}