@@ -385,7 +385,7 @@ void CGRecordLowering::accumulateFields(bool isNonVirtualBaseType) {
385385 Field = accumulateBitFields (isNonVirtualBaseType, Field, FieldEnd);
386386 assert ((Field == FieldEnd || !Field->isBitField ()) &&
387387 " Failed to accumulate all the bitfields" );
388- } else if (isEmptyField (Context, *Field, false , true )) {
388+ } else if (isEmptyFieldForLayout (Context, *Field)) {
389389 // Empty fields have no storage.
390390 ++Field;
391391 } else {
@@ -635,9 +635,7 @@ CGRecordLowering::accumulateBitFields(bool isNonVirtualBaseType,
635635 // non-reusable tail padding.
636636 CharUnits LimitOffset;
637637 for (auto Probe = Field; Probe != FieldEnd; ++Probe)
638- if (!Probe->isZeroLengthBitField (Context) &&
639- !(isEmptyField (Context, *Probe, false , true ) &&
640- !Probe->isBitField ())) {
638+ if (!isEmptyFieldForLayout (Context, *Probe)) {
641639 // A member with storage sets the limit.
642640 assert ((getFieldBitOffset (*Probe) % CharBits) == 0 &&
643641 " Next storage is not byte-aligned" );
@@ -735,7 +733,7 @@ void CGRecordLowering::accumulateBases() {
735733 // Bases can be zero-sized even if not technically empty if they
736734 // contain only a trailing array member.
737735 const CXXRecordDecl *BaseDecl = Base.getType ()->getAsCXXRecordDecl ();
738- if (!isEmptyRecord (Context, Base.getType (), false , true ) &&
736+ if (!isEmptyRecordForLayout (Context, Base.getType ()) &&
739737 !Context.getASTRecordLayout (BaseDecl).getNonVirtualSize ().isZero ())
740738 Members.push_back (MemberInfo (Layout.getBaseClassOffset (BaseDecl),
741739 MemberInfo::Base, getStorageType (BaseDecl), BaseDecl));
@@ -883,7 +881,7 @@ CGRecordLowering::calculateTailClippingOffset(bool isNonVirtualBaseType) const {
883881 if (!isNonVirtualBaseType && isOverlappingVBaseABI ())
884882 for (const auto &Base : RD->vbases ()) {
885883 const CXXRecordDecl *BaseDecl = Base.getType ()->getAsCXXRecordDecl ();
886- if (isEmptyRecord (Context, Base.getType (), false , true ))
884+ if (isEmptyRecordForLayout (Context, Base.getType ()))
887885 continue ;
888886 // If the vbase is a primary virtual base of some base, then it doesn't
889887 // get its own storage location but instead lives inside of that base.
@@ -899,7 +897,7 @@ CGRecordLowering::calculateTailClippingOffset(bool isNonVirtualBaseType) const {
899897void CGRecordLowering::accumulateVBases () {
900898 for (const auto &Base : RD->vbases ()) {
901899 const CXXRecordDecl *BaseDecl = Base.getType ()->getAsCXXRecordDecl ();
902- if (isEmptyRecord (Context, Base.getType (), false , true ))
900+ if (isEmptyRecordForLayout (Context, Base.getType ()))
903901 continue ;
904902 CharUnits Offset = Layout.getVBaseClassOffset (BaseDecl);
905903 // If the vbase is a primary virtual base of some base, then it doesn't
@@ -1165,8 +1163,7 @@ CodeGenTypes::ComputeRecordLayout(const RecordDecl *D, llvm::StructType *Ty) {
11651163 const FieldDecl *FD = *it;
11661164
11671165 // Ignore zero-sized fields.
1168- if (FD->isZeroLengthBitField (Context) ||
1169- (isEmptyField (Context, FD, false , true ) && !FD->isBitField ()))
1166+ if (isEmptyFieldForLayout (getContext (), FD))
11701167 continue ;
11711168
11721169 // For non-bit-fields, just check that the LLVM struct offset matches the
0 commit comments