[clang] [CIR] Mark record members as data, pad, or empty in CIRGen (PR #215175)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 14 14:14:41 PDT 2026


================
@@ -769,6 +826,12 @@ CIRGenTypes::computeRecordLayout(const RecordDecl *rd, cir::RecordType *ty) {
       // size and so needs no such exemption.)
       assert((rd->isUnion() || lowering.packed == baseLowering.packed) &&
              "Non-virtual and complete types must agree on packedness");
+      // Emptiness is a property of the decl, so the base subobject must answer
+      // the same way the complete object does.  The two are not comparable
+      // mark by mark: they see different sizes and so different tail padding.
+      assert((marksMatchABIEmptiness(astContext, rd, baseTy) ||
+              cgm.getDiags().hasErrorOccurred()) &&
----------------
erichkeane wrote:

An assert after NYI error is common/acceptable, I wouldn't even bother checking them, and let teh assert fire.

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


More information about the cfe-commits mailing list