[llvm] [DebugInfo] Emit negative DW_AT_bit_offset in explicit signed form (PR #87994)
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 12 13:30:19 PDT 2024
================
@@ -1664,7 +1666,12 @@ DIE &DwarfUnit::constructMemberDIE(DIE &Buffer, const DIDerivedType *DT) {
if (Asm->getDataLayout().isLittleEndian())
Offset = FieldSize - (Offset + Size);
- addUInt(MemberDie, dwarf::DW_AT_bit_offset, std::nullopt, Offset);
+ if (Offset < 0)
+ addSInt(MemberDie, dwarf::DW_AT_bit_offset, dwarf::DW_FORM_sdata,
----------------
dwblaikie wrote:
Does this need a version check to make sure it's used in DWARFv3, but not earlier? (or perhaps we don't support DWARFv2? Not sure - but the `useDWARF2Bitfields` above gives me pause)
https://github.com/llvm/llvm-project/pull/87994
More information about the llvm-commits
mailing list