[lldb] [llvm] Emit DIE's size in bits when size is not a multiple of 8 (PR #69741)

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 17:33:17 PST 2023


adrian-prantl wrote:

> I'm arguing it doesn't fit it particularly well. We use it for bit fields - which are pretty special, for instance, but it seems like this thing isn't quite like that - it does have a whole byte size (if you allocated an array of them, for instance, I'm guessing they're a byte each, right?) but then has some padding bits that can be reused in some circumstances? That's why I'm saying it seems like it fits more closely to the struct padding representation.

Swift is really clever at packing at packing aggregate types. For example, the discriminator bits for enums are always stored in unused bits of the payload type. For a contrived example, the type Optional<Optional<Bool>> has a size of 3 bits.

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


More information about the llvm-commits mailing list