OSDN Git Service

Debug info: Support DWARF4 bitfields via DW_AT_data_bit_offset.
authorAdrian Prantl <aprantl@apple.com>
Thu, 28 Apr 2016 15:37:48 +0000 (15:37 +0000)
committerAdrian Prantl <aprantl@apple.com>
Thu, 28 Apr 2016 15:37:48 +0000 (15:37 +0000)
commit9ed561fe46f41d7dd70ffc779bae4fb6a2f9ad66
treef373396fea45b7ded28f78c83389c01570dfef7c
parenta7480ba29ab6bf0191285f61e317c90e911ddf42
Debug info: Support DWARF4 bitfields via DW_AT_data_bit_offset.

The DWARF2 specification of DW_AT_bit_offset was written from the perspective of
a big-endian machine with unclear semantics for other systems.  DWARF4
deprecated DW_AT_bit_offset and introduced a new attribute DW_AT_data_bit_offset
that simply counts the number of bits from the beginning of the containing
entity regardless of endianness.

After this patch LLVM emits DW_AT_bit_offset for DWARF 2 or 3 and
DW_AT_data_bit_offset when DWARF 4 or later is requested.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267895 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DwarfUnit.cpp
test/DebugInfo/ARM/big-endian-bitfield.ll [new file with mode: 0644]
test/DebugInfo/X86/bitfields-dwarf4.ll [new file with mode: 0644]