diff options
author | David Blaikie <dblaikie@gmail.com> | 2015-01-28 02:34:53 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2015-01-28 02:34:53 +0000 |
commit | fa1a3c7cf5444ab3acd7bccee5ae47056fa4f506 (patch) | |
tree | 8d2eae0923e3a1bc91c7b0f7b58cad15e8bc0e11 /llvm/lib/CodeGen | |
parent | d7cb643ef0fee5f479e63d339e76ec45ae033673 (diff) | |
download | bcm5719-llvm-fa1a3c7cf5444ab3acd7bccee5ae47056fa4f506.tar.gz bcm5719-llvm-fa1a3c7cf5444ab3acd7bccee5ae47056fa4f506.zip |
PR22356: DebugInfo: Handle the size of a member where the type of that member is a typedef (or other sugar) of a declaration.
llvm-svn: 227290
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index 0d1979d7d83..f636142a7ed 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -627,10 +627,7 @@ static uint64_t getBaseTypeSize(DwarfDebug *DD, DIDerivedType Ty) { DIType BaseType = DD->resolve(Ty.getTypeDerivedFrom()); - // If this type is not derived from any type or the type is a declaration then - // take conservative approach. - if (!BaseType.isValid() || BaseType.isForwardDecl()) - return Ty.getSizeInBits(); + assert(BaseType.isValid()); // If this is a derived type, go ahead and get the base type, unless it's a // reference then it's just the size of the field. Pointer types have no need @@ -1474,7 +1471,7 @@ void DwarfUnit::constructMemberDIE(DIE &Buffer, DIDerivedType DT) { uint64_t FieldSize = getBaseTypeSize(DD, DT); uint64_t OffsetInBytes; - if (Size != FieldSize) { + if (FieldSize && Size != FieldSize) { // Handle bitfield, assume bytes are 8 bits. addUInt(MemberDie, dwarf::DW_AT_byte_size, None, FieldSize/8); addUInt(MemberDie, dwarf::DW_AT_bit_size, None, Size); |