[clang] [CIR] Classify around padding and zero-width bit-fields on x86_64 (PR #217517)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 20 06:22:10 PDT 2026
================
@@ -143,6 +158,12 @@ def CIR_RecordLayoutAttr : CIR_Attr<"RecordLayout", "record_layout", [
- `record_align_in_bytes`: from `ASTRecordLayout::getAlignment()`.
Needed because CIR's DataLayout cannot account for
`__attribute__((aligned(N)))`.
+ - `zero_width_bitfield_offsets` and `zero_width_bitfield_widths`: the
+ bit offset and declared bit width of each zero-width bit-field, one
+ entry per bit-field in each list. A zero-width bit-field occupies no
+ storage and so has no member in the record type, but x86_64 counts its
+ declared type as user data. Both lists are omitted from a record that
----------------
erichkeane wrote:
IF the declared type is what matters, shouldn't we just put that type in the size of the record layout? Keeping this extra data around like this is super awkward and going to be really difficult for any other user to do correctly.
https://github.com/llvm/llvm-project/pull/217517
More information about the cfe-commits
mailing list