aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-04-01 19:37:34 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-04-01 19:37:34 +0000
commit99eee3675e830ff367ae1fe35ce19fb49e7e4114 (patch)
tree82c736a69a1973f4487faa725b578d6d525624a1 /lib/CodeGen
parent008f54a54299eaafdaa940e2bdeaf55935ecd95a (diff)
Nonfragile ivar synthesis with property is in a continuation
class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68234 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/CGObjCMac.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index 6b3ced08bf..580641643f 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -1674,6 +1674,18 @@ static int countInheritedIvars(const ObjCInterfaceDecl *OI) {
if ((*I)->getPropertyIvarDecl())
++count;
}
+ // look into continuation class.
+ for (ObjCCategoryDecl *Categories = OI->getCategoryList();
+ Categories; Categories = Categories->getNextClassCategory()) {
+ if (!Categories->getIdentifier()) {
+ for (ObjCInterfaceDecl::prop_iterator I = Categories->prop_begin(),
+ E = Categories->prop_end(); I != E; ++I) {
+ if ((*I)->getPropertyIvarDecl())
+ ++count;
+ }
+ break;
+ }
+ }
return count;
}
@@ -1702,6 +1714,20 @@ static const ObjCInterfaceDecl *getInterfaceDeclForIvar(
if (IV->getIdentifier() == IVD->getIdentifier())
return OI;
}
+ // look into continuation class.
+ for (ObjCCategoryDecl *Categories = OI->getCategoryList();
+ Categories; Categories = Categories->getNextClassCategory()) {
+ if (!Categories->getIdentifier()) {
+ for (ObjCInterfaceDecl::prop_iterator I = Categories->prop_begin(),
+ E = Categories->prop_end(); I != E; ++I) {
+ ObjCPropertyDecl *PDecl = (*I);
+ if (ObjCIvarDecl *IV = PDecl->getPropertyIvarDecl())
+ if (IV->getIdentifier() == IVD->getIdentifier())
+ return OI;
+ }
+ break;
+ }
+ }
return getInterfaceDeclForIvar(OI->getSuperClass(), IVD);
}
@@ -4566,6 +4592,18 @@ llvm::Constant *CGObjCNonFragileABIMac::EmitIvarList(
E = OID->prop_end(); I != E; ++I)
if (ObjCIvarDecl *IV = (*I)->getPropertyIvarDecl())
OIvars.push_back(IV);
+ // look into continuation class.
+ for (ObjCCategoryDecl *Categories = OID->getCategoryList();
+ Categories; Categories = Categories->getNextClassCategory())
+ if (!Categories->getIdentifier()) {
+ for (ObjCInterfaceDecl::prop_iterator I = Categories->prop_begin(),
+ E = Categories->prop_end(); I != E; ++I) {
+ if (ObjCIvarDecl *IV = (*I)->getPropertyIvarDecl())
+ OIvars.push_back(IV);
+ }
+ break;
+ }
+
unsigned iv = 0;
for (RecordDecl::field_iterator e = RD->field_end(); i != e; ++i) {
FieldDecl *Field = *i;