================
@@ -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
+  /// tell the bytes after the unit from padding.  A zero-length array holds
+  /// no storage, and `isZeroWidthBitField` answers true for it as well as for
+  /// a zero-width bit-field, so the layout walks pass over both.
+  ///
+  /// The bits counted are those past the member, not past the unit: a
+  /// zero-sized member reports the offset where the storage ahead of it ends,
+  /// so a caller measuring from anywhere else claims bytes twice.
+  MemberInfo makeDeclaredReachInfo(CharUnits offset, uint64_t excessInBits) {
----------------
adams381 wrote:

I've renamed to `makeDeclaredExtentInfo`, which parallels 
`makeZeroWidthBitFieldInfo` directly above it.  If the representation changes 
as proposed in my top-level comment, this helper goes away entirely.

https://github.com/llvm/llvm-project/pull/220069
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to