[clang] [llvm] [DebugInfo] Fix endianness in DW_AT_const_value for constexpr arrays (PR #184804)
Michael Buch via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 6 07:11:22 PST 2026
================
@@ -247,10 +245,16 @@ void DwarfUnit::addIntAsBlock(DIE &Die, dwarf::Attribute Attribute, const APInt
c = Ptr64[i / 8] >> (8 * (i & 7));
else
c = Ptr64[(NumBytes - 1 - i) / 8] >> (8 * ((NumBytes - 1 - i) & 7));
- addUInt(*Block, dwarf::DW_FORM_data1, c);
+ addUInt(Block, dwarf::DW_FORM_data1, c);
}
+}
- addBlock(Die, Attribute, Block);
+void DwarfUnit::addIntAsBlock(DIE &Die, dwarf::Attribute Attribute,
+ const APInt &Val) {
+ DIEBlock *Block = new (DIEValueAllocator) DIEBlock;
+ addIntToBlock(*Block, Val);
+ Block->computeSize(Asm->getDwarfFormParams());
----------------
Michael137 wrote:
Doesn't `DwarfUnit::addBlock` already do this?
https://github.com/llvm/llvm-project/pull/184804
More information about the cfe-commits
mailing list