[clang] [llvm] [DebugInfo] Emit DW_AT_bit_size for _BitInt types and others (PR #164372)

Michael Buch via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 21 04:20:26 PDT 2025


================
@@ -766,8 +766,17 @@ void DwarfUnit::constructTypeDIE(DIE &Buffer, const DIBasicType *BTy) {
     addUInt(Buffer, dwarf::DW_AT_encoding, dwarf::DW_FORM_data1,
             BTy->getEncoding());
 
-  uint64_t Size = BTy->getSizeInBits() >> 3;
-  addUInt(Buffer, dwarf::DW_AT_byte_size, std::nullopt, Size);
+  uint64_t SizeInBytes = divideCeil(BTy->getSizeInBits(), 8);
----------------
Michael137 wrote:

I know GCC emits both bit-size and byte-size, but is the byte-size here really useful if we have the bit-size?

https://github.com/llvm/llvm-project/pull/164372


More information about the cfe-commits mailing list