diff options
author | Devang Patel <dpatel@apple.com> | 2009-10-30 22:09:30 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-10-30 22:09:30 +0000 |
commit | 7cb7e12c08c8d723a64a51833028470077e85316 (patch) | |
tree | b09fd948ac09dbb2f43d52feb2e809a572e9cc47 /lib/Analysis/DebugInfo.cpp | |
parent | 43301206b90dc7a8008ebf69c4d214530c0cd3aa (diff) |
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
Diffstat (limited to 'lib/Analysis/DebugInfo.cpp')
-rw-r--r-- | lib/Analysis/DebugInfo.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp index 2a6e04eb74..1d340b907a 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(); } |