diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-11-05 17:17:44 +0000 |
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-11-05 17:17:44 +0000 |
| commit | 72cc50852bec44580ee7efe1aa2076273008a6ae (patch) | |
| tree | adc0bc5dc9cb37579ee90d3c0f08c98c0711bebe /lib/Analysis/DebugInfo.cpp | |
| parent | fc25e9aa52455d7aa75f3237afd79b8d89548bb5 (diff) | |
Notes
Diffstat (limited to 'lib/Analysis/DebugInfo.cpp')
| -rw-r--r-- | lib/Analysis/DebugInfo.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp index 7bff11ec5b45..b64dbf433aae 100644 --- a/lib/Analysis/DebugInfo.cpp +++ b/lib/Analysis/DebugInfo.cpp @@ -401,12 +401,18 @@ bool DIVariable::Verify() const { /// getOriginalTypeSize - If this type is derived from a base type then /// return base type size. uint64_t DIDerivedType::getOriginalTypeSize() const { - DIType BT = getTypeDerivedFrom(); - if (!BT.isNull() && BT.isDerivedType()) - return DIDerivedType(BT.getNode()).getOriginalTypeSize(); - if (BT.isNull()) - return getSizeInBits(); - return BT.getSizeInBits(); + unsigned Tag = getTag(); + if (Tag == dwarf::DW_TAG_member || Tag == dwarf::DW_TAG_typedef || + Tag == dwarf::DW_TAG_const_type || Tag == dwarf::DW_TAG_volatile_type || + Tag == dwarf::DW_TAG_restrict_type) { + DIType BaseType = getTypeDerivedFrom(); + if (BaseType.isDerivedType()) + return DIDerivedType(BaseType.getNode()).getOriginalTypeSize(); + else + return BaseType.getSizeInBits(); + } + + return getSizeInBits(); } /// describes - Return true if this subprogram provides debugging |
