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 | 13cb2810130493c17d28c3c8d89595962a13f7f0 (patch) | |
| tree | 3676fd4783bf59d0b7c81cd6c81d43386a91da44 | |
| parent | 5c2040b1820b04b51fcc092ddb69cb7295fc8d87 (diff) | |
| download | bcm5719-llvm-13cb2810130493c17d28c3c8d89595962a13f7f0.tar.gz bcm5719-llvm-13cb2810130493c17d28c3c8d89595962a13f7f0.zip | |
If a type is derived from a derived type then calculate size appropriately.
llvm-svn: 85619
| -rw-r--r-- | llvm/lib/Analysis/DebugInfo.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp index 2a6e04eb743..1d340b907a9 100644 --- a/llvm/lib/Analysis/DebugInfo.cpp +++ b/llvm/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(); } |

