1111//===----------------------------------------------------------------------===//
1212
1313#include "CGOpenMPRuntime.h"
14+ #include "ABIInfoImpl.h"
1415#include "CGCXXABI.h"
1516#include "CGCleanup.h"
1617#include "CGRecordLayout.h"
@@ -7728,23 +7729,28 @@ class MappableExprsHandler {
77287729 for (const auto &I : RD->bases()) {
77297730 if (I.isVirtual())
77307731 continue;
7731- const auto *Base = I.getType()->getAsCXXRecordDecl();
7732+
7733+ QualType BaseTy = I.getType();
7734+ const auto *Base = BaseTy->getAsCXXRecordDecl();
77327735 // Ignore empty bases.
7733- if (Base->isEmpty() || CGF.getContext()
7734- .getASTRecordLayout(Base)
7735- .getNonVirtualSize()
7736- .isZero())
7736+ if (isEmptyRecordForLayout(CGF.getContext(), BaseTy) ||
7737+ CGF.getContext()
7738+ .getASTRecordLayout(Base)
7739+ .getNonVirtualSize()
7740+ .isZero())
77377741 continue;
77387742
77397743 unsigned FieldIndex = RL.getNonVirtualBaseLLVMFieldNo(Base);
77407744 RecordLayout[FieldIndex] = Base;
77417745 }
77427746 // Fill in virtual bases.
77437747 for (const auto &I : RD->vbases()) {
7744- const auto *Base = I.getType()->getAsCXXRecordDecl ();
7748+ QualType BaseTy = I.getType();
77457749 // Ignore empty bases.
7746- if (Base->isEmpty( ))
7750+ if (isEmptyRecordForLayout(CGF.getContext(), BaseTy ))
77477751 continue;
7752+
7753+ const auto *Base = BaseTy->getAsCXXRecordDecl();
77487754 unsigned FieldIndex = RL.getVirtualBaseIndex(Base);
77497755 if (RecordLayout[FieldIndex])
77507756 continue;
@@ -7755,7 +7761,8 @@ class MappableExprsHandler {
77557761 for (const auto *Field : RD->fields()) {
77567762 // Fill in non-bitfields. (Bitfields always use a zero pattern, which we
77577763 // will fill in later.)
7758- if (!Field->isBitField() && !Field->isZeroSize(CGF.getContext())) {
7764+ if (!Field->isBitField() &&
7765+ !isEmptyFieldForLayout(CGF.getContext(), Field)) {
77597766 unsigned FieldIndex = RL.getLLVMFieldNo(Field);
77607767 RecordLayout[FieldIndex] = Field;
77617768 }
0 commit comments