1111//===----------------------------------------------------------------------===//
1212
1313#include "CGOpenMPRuntime.h"
14+ #include "ABIInfoImpl.h"
1415#include "CGCXXABI.h"
1516#include "CGCleanup.h"
1617#include "CGRecordLayout.h"
@@ -7719,23 +7720,28 @@ class MappableExprsHandler {
77197720 for (const auto &I : RD->bases()) {
77207721 if (I.isVirtual())
77217722 continue;
7722- const auto *Base = I.getType()->getAsCXXRecordDecl();
7723+
7724+ QualType BaseTy = I.getType();
7725+ const auto *Base = BaseTy->getAsCXXRecordDecl();
77237726 // Ignore empty bases.
7724- if (Base->isEmpty() || CGF.getContext()
7725- .getASTRecordLayout(Base)
7726- .getNonVirtualSize()
7727- .isZero())
7727+ if (isEmptyRecordForLayout(CGF.getContext(), BaseTy) ||
7728+ CGF.getContext()
7729+ .getASTRecordLayout(Base)
7730+ .getNonVirtualSize()
7731+ .isZero())
77287732 continue;
77297733
77307734 unsigned FieldIndex = RL.getNonVirtualBaseLLVMFieldNo(Base);
77317735 RecordLayout[FieldIndex] = Base;
77327736 }
77337737 // Fill in virtual bases.
77347738 for (const auto &I : RD->vbases()) {
7735- const auto *Base = I.getType()->getAsCXXRecordDecl ();
7739+ QualType BaseTy = I.getType();
77367740 // Ignore empty bases.
7737- if (Base->isEmpty( ))
7741+ if (isEmptyRecordForLayout(CGF.getContext(), BaseTy ))
77387742 continue;
7743+
7744+ const auto *Base = BaseTy->getAsCXXRecordDecl();
77397745 unsigned FieldIndex = RL.getVirtualBaseIndex(Base);
77407746 if (RecordLayout[FieldIndex])
77417747 continue;
@@ -7746,7 +7752,8 @@ class MappableExprsHandler {
77467752 for (const auto *Field : RD->fields()) {
77477753 // Fill in non-bitfields. (Bitfields always use a zero pattern, which we
77487754 // will fill in later.)
7749- if (!Field->isBitField() && !Field->isZeroSize(CGF.getContext())) {
7755+ if (!Field->isBitField() &&
7756+ !isEmptyFieldForLayout(CGF.getContext(), Field)) {
77507757 unsigned FieldIndex = RL.getLLVMFieldNo(Field);
77517758 RecordLayout[FieldIndex] = Field;
77527759 }
0 commit comments