diff options
author | Adrian Prantl <aprantl@apple.com> | 2015-06-27 21:55:00 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2015-06-27 21:55:00 +0000 |
commit | cb53eedc790fdefb5962fd26de8ca02800c2221c (patch) | |
tree | d4a32b0a53f5dbd608010af97fedec59a2228459 /llvm/lib/CodeGen | |
parent | d25187ff9f064ecf5235aa49b04a095c15d51e72 (diff) | |
download | bcm5719-llvm-cb53eedc790fdefb5962fd26de8ca02800c2221c.tar.gz bcm5719-llvm-cb53eedc790fdefb5962fd26de8ca02800c2221c.zip |
Revert "Debug Info: One more bitfield bugfix. While yesterday's r240853 fixed"
This reverts commit 240890. Breaking the gdb buildbot.
llvm-svn: 240893
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index ca9951eda42..98a224787d5 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -1361,29 +1361,24 @@ void DwarfUnit::constructMemberDIE(DIE &Buffer, const DIDerivedType *DT) { // | ... |b1|b2|b3|b4| // +-----------+-----*-----+-----*-----+-- // | | |<-- Size ->| | - // |<---- Offset --->| | |<--->| - // | | | | \_ DW_AT_bit_offset (little endian) - // | |<--->| | - // |<--big-e.->| \_ StartBitOffset = DW_AT_bit_offset (big endian) - // | ^ | = DW_AT_data_bit_offset (biendian) - // | OffsetInBytes | - // | v | - // |<----little-endian---->| + // |<---- Offset --->| |<--->| + // | | | \_ DW_AT_bit_offset (little endian) + // | |<--->| + // |<--------->| \_ StartBitOffset = DW_AT_bit_offset (big endian) + // \ = DW_AT_data_bit_offset (biendian) + // \_ OffsetInBytes uint64_t Offset = DT->getOffsetInBits(); uint64_t Align = DT->getAlignInBits() ? DT->getAlignInBits() : FieldSize; uint64_t AlignMask = ~(Align - 1); // The bits from the start of the storage unit to the start of the field. uint64_t StartBitOffset = Offset - (Offset & AlignMask); - // OffsetInBytes is the byte offset of the field's aligned storage unit - // inside the struct. - uint64_t DwarfBitOffset; - if (Asm->getDataLayout().isLittleEndian()) { - DwarfBitOffset = OffsetToAlignment(Offset + Size, Align); - OffsetInBytes = ((Offset + Size) & AlignMask) / 8; - } else { - DwarfBitOffset = StartBitOffset; - OffsetInBytes = (Offset - StartBitOffset) / 8; - } + // The endian-dependent DWARF 2 offset. + uint64_t DwarfBitOffset = Asm->getDataLayout().isLittleEndian() + ? OffsetToAlignment(Offset + Size, Align) + : StartBitOffset; + + // The byte offset of the field's aligned storage unit inside the struct. + OffsetInBytes = (Offset - StartBitOffset) / 8; addUInt(MemberDie, dwarf::DW_AT_bit_offset, None, DwarfBitOffset); } else // This is not a bitfield. |