llvm.org GIT mirror llvm / 7cb828a
Debug Info: Clarify the documentation for bitfields emission. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240835 91177308-0d34-0410-b5e6-96231b3b80d8 Adrian Prantl 4 years ago
1 changed file(s) with 7 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
13451345 addUInt(MemberDie, dwarf::DW_AT_byte_size, None, FieldSize/8);
13461346 addUInt(MemberDie, dwarf::DW_AT_bit_size, None, Size);
13471347
1348 // The DWARF 2 DW_AT_bit_offset is counting the bits between
1349 // the high end of the aligned storage unit containing the bit
1350 // field to the high end of the bit field.
1351 //
1352 // FIXME: DWARF 4 states that DW_AT_data_bit_offset (which
1353 // counts from the beginning, regardless of endianness) should
1354 // be used instead.
13481355 uint64_t Offset = DT->getOffsetInBits();
13491356 uint64_t AlignMask = ~(DT->getAlignInBits() - 1);
13501357 uint64_t HiMark = (Offset + FieldSize) & AlignMask;
13561363 Offset = FieldSize - (Offset + Size);
13571364 addUInt(MemberDie, dwarf::DW_AT_bit_offset, None, Offset);
13581365
1359 // Here DW_AT_data_member_location points to the anonymous
1360 // field that includes this bit field.
13611366 OffsetInBytes = FieldOffset >> 3;
13621367 } else
13631368 // This is not a bitfield.