10
10
//
11
11
// ===----------------------------------------------------------------------===//
12
12
13
- #include " ABIInfoImpl.h"
14
- #include " CGCXXABI.h"
15
13
#include " CGRecordLayout.h"
14
+ #include " CGCXXABI.h"
16
15
#include " CodeGenTypes.h"
17
16
#include " clang/AST/ASTContext.h"
18
17
#include " clang/AST/Attr.h"
@@ -385,7 +384,7 @@ void CGRecordLowering::accumulateFields(bool isNonVirtualBaseType) {
385
384
Field = accumulateBitFields (isNonVirtualBaseType, Field, FieldEnd);
386
385
assert ((Field == FieldEnd || !Field->isBitField ()) &&
387
386
" Failed to accumulate all the bitfields" );
388
- } else if (isEmptyFieldForLayout (Context, *Field )) {
387
+ } else if (Field-> isZeroSize (Context)) {
389
388
// Empty fields have no storage.
390
389
++Field;
391
390
} else {
@@ -634,7 +633,7 @@ CGRecordLowering::accumulateBitFields(bool isNonVirtualBaseType,
634
633
// non-reusable tail padding.
635
634
CharUnits LimitOffset;
636
635
for (auto Probe = Field; Probe != FieldEnd; ++Probe)
637
- if (!isEmptyFieldForLayout (Context, *Probe )) {
636
+ if (!Probe-> isZeroSize (Context)) {
638
637
// A member with storage sets the limit.
639
638
assert ((getFieldBitOffset (*Probe) % CharBits) == 0 &&
640
639
" Next storage is not byte-aligned" );
@@ -732,7 +731,7 @@ void CGRecordLowering::accumulateBases() {
732
731
// Bases can be zero-sized even if not technically empty if they
733
732
// contain only a trailing array member.
734
733
const CXXRecordDecl *BaseDecl = Base.getType ()->getAsCXXRecordDecl ();
735
- if (!isEmptyRecordForLayout (Context, Base. getType () ) &&
734
+ if (!BaseDecl-> isEmpty ( ) &&
736
735
!Context.getASTRecordLayout (BaseDecl).getNonVirtualSize ().isZero ())
737
736
Members.push_back (MemberInfo (Layout.getBaseClassOffset (BaseDecl),
738
737
MemberInfo::Base, getStorageType (BaseDecl), BaseDecl));
@@ -880,7 +879,7 @@ CGRecordLowering::calculateTailClippingOffset(bool isNonVirtualBaseType) const {
880
879
if (!isNonVirtualBaseType && isOverlappingVBaseABI ())
881
880
for (const auto &Base : RD->vbases ()) {
882
881
const CXXRecordDecl *BaseDecl = Base.getType ()->getAsCXXRecordDecl ();
883
- if (isEmptyRecordForLayout (Context, Base. getType () ))
882
+ if (BaseDecl-> isEmpty ( ))
884
883
continue ;
885
884
// If the vbase is a primary virtual base of some base, then it doesn't
886
885
// get its own storage location but instead lives inside of that base.
@@ -896,7 +895,7 @@ CGRecordLowering::calculateTailClippingOffset(bool isNonVirtualBaseType) const {
896
895
void CGRecordLowering::accumulateVBases () {
897
896
for (const auto &Base : RD->vbases ()) {
898
897
const CXXRecordDecl *BaseDecl = Base.getType ()->getAsCXXRecordDecl ();
899
- if (isEmptyRecordForLayout (Context, Base. getType () ))
898
+ if (BaseDecl-> isEmpty ( ))
900
899
continue ;
901
900
CharUnits Offset = Layout.getVBaseClassOffset (BaseDecl);
902
901
// 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) {
1162
1161
const FieldDecl *FD = *it;
1163
1162
1164
1163
// Ignore zero-sized fields.
1165
- if (isEmptyFieldForLayout (getContext (), FD ))
1164
+ if (FD-> isZeroSize (getContext ()))
1166
1165
continue ;
1167
1166
1168
1167
// For non-bit-fields, just check that the LLVM struct offset matches the
0 commit comments