================ @@ -1699,11 +1699,18 @@ class CGObjCGNUstep2 : public CGObjCGNUstep { llvm::Value *EmitIvarOffset(CodeGenFunction &CGF, const ObjCInterfaceDecl *Interface, const ObjCIvarDecl *Ivar) override { - const std::string Name = GetIVarOffsetVariableName(Ivar->getContainingInterface(), Ivar); + const ObjCInterfaceDecl *ContainingInterface = + Ivar->getContainingInterface(); + const std::string Name = + GetIVarOffsetVariableName(ContainingInterface, Ivar); llvm::GlobalVariable *IvarOffsetPointer = TheModule.getNamedGlobal(Name); - if (!IvarOffsetPointer) + if (!IvarOffsetPointer) { IvarOffsetPointer = new llvm::GlobalVariable(TheModule, IntTy, false, llvm::GlobalValue::ExternalLinkage, nullptr, Name); + if (Ivar->getAccessControl() != ObjCIvarDecl::Private && + Ivar->getAccessControl() != ObjCIvarDecl::Package) ---------------- qmfrederik wrote:
I think the added tests demonstrate that unmarked ivars are considered protected, so let me know if that resolves this comment? https://github.com/llvm/llvm-project/pull/107604 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits