From: Devang Patel Date: Fri, 30 Oct 2009 22:09:30 +0000 (+0000) Subject: If a type is derived from a derived type then calculate size appropriately. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=7cb7e12c08c8d723a64a51833028470077e85316;p=oota-llvm.git If a type is derived from a derived type then calculate size appropriately. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85619 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp index 2a6e04eb743..1d340b907a9 100644 --- a/lib/Analysis/DebugInfo.cpp +++ b/lib/Analysis/DebugInfo.cpp @@ -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(); }