[llvm-commits] [llvm] r85619 - /llvm/trunk/lib/Analysis/DebugInfo.cpp
Devang Patel
dpatel at apple.com
Fri Oct 30 15:09:30 PDT 2009
Author: dpatel
Date: Fri Oct 30 17:09:30 2009
New Revision: 85619
URL: http://llvm.org/viewvc/llvm-project?rev=85619&view=rev
Log:
If a type is derived from a derived type then calculate size appropriately.
Modified:
llvm/trunk/lib/Analysis/DebugInfo.cpp
Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=85619&r1=85618&r2=85619&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/DebugInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/DebugInfo.cpp Fri Oct 30 17:09:30 2009
@@ -398,10 +398,10 @@
/// 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();
}
More information about the llvm-commits
mailing list