Skip to content

Commit 771e5da

Browse files
committed
[domain availability] Ignore disabled ivars during CodeGen
Fix a bug where disabled ivars weren't being ignored during codegen for method .cxx_destruct and ivar bitmap layout. rdar://165722993
1 parent 3c7741d commit 771e5da

File tree

3 files changed

+107
-68
lines changed

3 files changed

+107
-68
lines changed

clang/lib/CodeGen/CGObjC.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1722,6 +1722,9 @@ static void emitCXXDestructMethod(CodeGenFunction &CGF,
17221722
const ObjCInterfaceDecl *iface = impl->getClassInterface();
17231723
for (const ObjCIvarDecl *ivar = iface->all_declared_ivar_begin();
17241724
ivar; ivar = ivar->getNextIvar()) {
1725+
if (CGF.CGM.getContext().hasUnavailableFeature(ivar))
1726+
continue;
1727+
17251728
QualType type = ivar->getType();
17261729

17271730
// Check whether the ivar is a destructible type.

clang/lib/CodeGen/CGObjCMac.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5488,7 +5488,8 @@ CGObjCCommonMac::BuildIvarLayout(const ObjCImplementationDecl *OMD,
54885488
if (CGM.getLangOpts().getGC() == LangOptions::NonGC) {
54895489
for (const ObjCIvarDecl *IVD = OI->all_declared_ivar_begin(); IVD;
54905490
IVD = IVD->getNextIvar())
5491-
ivars.push_back(IVD);
5491+
if (!CGM.getContext().hasUnavailableFeature(IVD))
5492+
ivars.push_back(IVD);
54925493

54935494
if (isNonFragileABI()) {
54945495
baseOffset = beginOffset; // InstanceStart

0 commit comments

Comments
 (0)