1010//
1111// ===----------------------------------------------------------------------===//
1212
13- #include " ABIInfoImpl.h"
14- #include " CGCXXABI.h"
1513#include " CGRecordLayout.h"
14+ #include " CGCXXABI.h"
1615#include " CodeGenTypes.h"
1716#include " clang/AST/ASTContext.h"
1817#include " clang/AST/Attr.h"
@@ -385,7 +384,7 @@ void CGRecordLowering::accumulateFields(bool isNonVirtualBaseType) {
385384 Field = accumulateBitFields (isNonVirtualBaseType, Field, FieldEnd);
386385 assert ((Field == FieldEnd || !Field->isBitField ()) &&
387386 " Failed to accumulate all the bitfields" );
388- } else if (isEmptyFieldForLayout (Context, *Field )) {
387+ } else if (Field-> isZeroSize (Context)) {
389388 // Empty fields have no storage.
390389 ++Field;
391390 } else {
@@ -634,7 +633,7 @@ CGRecordLowering::accumulateBitFields(bool isNonVirtualBaseType,
634633 // non-reusable tail padding.
635634 CharUnits LimitOffset;
636635 for (auto Probe = Field; Probe != FieldEnd; ++Probe)
637- if (!isEmptyFieldForLayout (Context, *Probe )) {
636+ if (!Probe-> isZeroSize (Context)) {
638637 // A member with storage sets the limit.
639638 assert ((getFieldBitOffset (*Probe) % CharBits) == 0 &&
640639 " Next storage is not byte-aligned" );
@@ -732,7 +731,7 @@ void CGRecordLowering::accumulateBases() {
732731 // Bases can be zero-sized even if not technically empty if they
733732 // contain only a trailing array member.
734733 const CXXRecordDecl *BaseDecl = Base.getType ()->getAsCXXRecordDecl ();
735- if (!isEmptyRecordForLayout (Context, Base. getType () ) &&
734+ if (!BaseDecl-> isEmpty ( ) &&
736735 !Context.getASTRecordLayout (BaseDecl).getNonVirtualSize ().isZero ())
737736 Members.push_back (MemberInfo (Layout.getBaseClassOffset (BaseDecl),
738737 MemberInfo::Base, getStorageType (BaseDecl), BaseDecl));
@@ -880,7 +879,7 @@ CGRecordLowering::calculateTailClippingOffset(bool isNonVirtualBaseType) const {
880879 if (!isNonVirtualBaseType && isOverlappingVBaseABI ())
881880 for (const auto &Base : RD->vbases ()) {
882881 const CXXRecordDecl *BaseDecl = Base.getType ()->getAsCXXRecordDecl ();
883- if (isEmptyRecordForLayout (Context, Base. getType () ))
882+ if (BaseDecl-> isEmpty ( ))
884883 continue ;
885884 // If the vbase is a primary virtual base of some base, then it doesn't
886885 // get its own storage location but instead lives inside of that base.
@@ -896,7 +895,7 @@ CGRecordLowering::calculateTailClippingOffset(bool isNonVirtualBaseType) const {
896895void CGRecordLowering::accumulateVBases () {
897896 for (const auto &Base : RD->vbases ()) {
898897 const CXXRecordDecl *BaseDecl = Base.getType ()->getAsCXXRecordDecl ();
899- if (isEmptyRecordForLayout (Context, Base. getType () ))
898+ if (BaseDecl-> isEmpty ( ))
900899 continue ;
901900 CharUnits Offset = Layout.getVBaseClassOffset (BaseDecl);
902901 // If the vbase is a primary virtual base of some base, then it doesn't
@@ -1162,7 +1161,7 @@ CodeGenTypes::ComputeRecordLayout(const RecordDecl *D, llvm::StructType *Ty) {
11621161 const FieldDecl *FD = *it;
11631162
11641163 // Ignore zero-sized fields.
1165- if (isEmptyFieldForLayout (getContext (), FD ))
1164+ if (FD-> isZeroSize (getContext ()))
11661165 continue ;
11671166
11681167 // For non-bit-fields, just check that the LLVM struct offset matches the
0 commit comments