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

Adam Smith via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 2 05:47:11 PDT 2026


================
@@ -79,6 +79,24 @@ struct CIRRecordLowering final {
         cir::ArrayType::get(cirGenTypes.convertTypeForMem(field->getType()), 0),
         cir::RecordMemberKind::BitField);
   }
+
+  /// A member recording that declared types reach \p excessInBits past where
+  /// it sits.  An access unit's width is the compiler's choice, so it can be
+  /// narrower than the types declared in it, and the ABI reads that reach to
----------------
adams381 wrote:

I've been using "reach" and "extent" interchangeably here.  Perhaps that has been causing the confusion.  Neither is from the ABI spec.  The whole idea boils down to the compiler chosen storage for the bitfield can be smaller than the declared size, so how far does the declared size extend/reach beyond the compiler chosen size?

I've renamed with "extent" throughout: `makeDeclaredExtentInfo`, `declaredExtentBits`, `extentOutrunsMembers`, `addDeclaredExtent`, the prose in both files, and the two test files, which are now `-bitfield-extent`.

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


More information about the cfe-commits mailing list