[llvm] [Dwarf] Emit `DW_AT_bit_size` for non-byte-sized types (PR #137118)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 24 21:49:29 PDT 2025


dtcxzyw wrote:

> Could you point me to where you've written up (or write it up here) where we need non-byte sized objects? A C++ `bool` is still byte sized (its `sizeof` is 1) so I wouldn't expect to want/need bit-sized things to implement C++ `bool`... is there something else going on here?

The sequence `DW_OP_LLVM_convert, 1, DW_ATE_unsigned` is generated by `salvageDebugInfo`:
https://github.com/llvm/llvm-project/blob/5717c5f385d3b8f5b395c3013aaba9929a618aa3/llvm/lib/Transforms/Utils/Local.cpp#L2630-L2633


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


More information about the llvm-commits mailing list