mirror of
https://github.com/RPCSX/llvm.git
synced 2025-05-13 10:56:01 +00:00
Revert "Debug Info: One more bitfield bugfix. While yesterday's r240853 fixed"
This reverts commit 240890. Breaking the gdb buildbot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240893 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0bd9021d62
commit
1e7ecc8e57
@ -1361,29 +1361,24 @@ void DwarfUnit::constructMemberDIE(DIE &Buffer, const DIDerivedType *DT) {
|
|||||||
// | ... |b1|b2|b3|b4|
|
// | ... |b1|b2|b3|b4|
|
||||||
// +-----------+-----*-----+-----*-----+--
|
// +-----------+-----*-----+-----*-----+--
|
||||||
// | | |<-- Size ->| |
|
// | | |<-- Size ->| |
|
||||||
// |<---- Offset --->| | |<--->|
|
// |<---- Offset --->| |<--->|
|
||||||
// | | | | \_ DW_AT_bit_offset (little endian)
|
// | | | \_ DW_AT_bit_offset (little endian)
|
||||||
// | |<--->| |
|
// | |<--->|
|
||||||
// |<--big-e.->| \_ StartBitOffset = DW_AT_bit_offset (big endian)
|
// |<--------->| \_ StartBitOffset = DW_AT_bit_offset (big endian)
|
||||||
// | ^ | = DW_AT_data_bit_offset (biendian)
|
// \ = DW_AT_data_bit_offset (biendian)
|
||||||
// | OffsetInBytes |
|
// \_ OffsetInBytes
|
||||||
// | v |
|
|
||||||
// |<----little-endian---->|
|
|
||||||
uint64_t Offset = DT->getOffsetInBits();
|
uint64_t Offset = DT->getOffsetInBits();
|
||||||
uint64_t Align = DT->getAlignInBits() ? DT->getAlignInBits() : FieldSize;
|
uint64_t Align = DT->getAlignInBits() ? DT->getAlignInBits() : FieldSize;
|
||||||
uint64_t AlignMask = ~(Align - 1);
|
uint64_t AlignMask = ~(Align - 1);
|
||||||
// The bits from the start of the storage unit to the start of the field.
|
// The bits from the start of the storage unit to the start of the field.
|
||||||
uint64_t StartBitOffset = Offset - (Offset & AlignMask);
|
uint64_t StartBitOffset = Offset - (Offset & AlignMask);
|
||||||
// OffsetInBytes is the byte offset of the field's aligned storage unit
|
// The endian-dependent DWARF 2 offset.
|
||||||
// inside the struct.
|
uint64_t DwarfBitOffset = Asm->getDataLayout().isLittleEndian()
|
||||||
uint64_t DwarfBitOffset;
|
? OffsetToAlignment(Offset + Size, Align)
|
||||||
if (Asm->getDataLayout().isLittleEndian()) {
|
: StartBitOffset;
|
||||||
DwarfBitOffset = OffsetToAlignment(Offset + Size, Align);
|
|
||||||
OffsetInBytes = ((Offset + Size) & AlignMask) / 8;
|
// The byte offset of the field's aligned storage unit inside the struct.
|
||||||
} else {
|
OffsetInBytes = (Offset - StartBitOffset) / 8;
|
||||||
DwarfBitOffset = StartBitOffset;
|
|
||||||
OffsetInBytes = (Offset - StartBitOffset) / 8;
|
|
||||||
}
|
|
||||||
addUInt(MemberDie, dwarf::DW_AT_bit_offset, None, DwarfBitOffset);
|
addUInt(MemberDie, dwarf::DW_AT_bit_offset, None, DwarfBitOffset);
|
||||||
} else
|
} else
|
||||||
// This is not a bitfield.
|
// This is not a bitfield.
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
; CHECK: DW_AT_byte_size {{.*}} (0x04)
|
; CHECK: DW_AT_byte_size {{.*}} (0x04)
|
||||||
; CHECK: DW_AT_bit_size {{.*}} (0x1c)
|
; CHECK: DW_AT_bit_size {{.*}} (0x1c)
|
||||||
; CHECK: DW_AT_bit_offset {{.*}} (0x18)
|
; CHECK: DW_AT_bit_offset {{.*}} (0x18)
|
||||||
; CHECK: DW_AT_data_member_location {{.*}}04
|
; CHECK: DW_AT_data_member_location {{.*}}00
|
||||||
target datalayout = "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"
|
target datalayout = "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"
|
||||||
target triple = "thumbv7-apple-ios"
|
target triple = "thumbv7-apple-ios"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user