[clang] [CIR] Record how far a bit-field's declared types extend on x86_64 (PR #220069)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 2 07:01:17 PDT 2026


================
@@ -79,6 +79,25 @@ struct CIRRecordLowering final {
         cir::ArrayType::get(cirGenTypes.convertTypeForMem(field->getType()), 0),
         cir::RecordMemberKind::BitField);
   }
+
+  /// An access unit can be narrower than the types its bit-fields were
+  /// declared with, so the unit's extent does not say how far the declared
+  /// data runs.  This member carries the difference: the declared extent ends
+  /// \p excessInBits past \p offset.  It holds no storage, taking the same
+  /// zero-length-array shape as a zero-width bit-field so the record layout
+  /// walks skip it.
----------------
erichkeane wrote:

Can we get a quick example here?  I'm still not getting th is.

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


More information about the cfe-commits mailing list