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)
commitf393d313ece93b7ab10bbbc0776bf10e4617cfda
treeb53c3ff4fe5d2dfcdb932aebc5369a1d50b97b44
parentbcdce3fd85dfb3942c8996430e429824667a6ed1
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.

llvm-svn: 267895
llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
llvm/test/DebugInfo/ARM/big-endian-bitfield.ll [new file with mode: 0644]
llvm/test/DebugInfo/X86/bitfields-dwarf4.ll [new file with mode: 0644]