make property addition work list all other "add" methods. Do
the allocation in the class, not in sema.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48433 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 121004d..335122e 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -705,13 +705,8 @@
// TODO: property declaration in category and protocols.
if (pNum != 0)
- if (ObjCInterfaceDecl *IDecl = dyn_cast<ObjCInterfaceDecl>(ClassDecl)) {
- // FIXME: Move the memory allocation into setPropertyDecls!
- ObjCPropertyDecl **properties = new ObjCPropertyDecl*[pNum];
- memcpy(properties, allProperties, pNum*sizeof(ObjCPropertyDecl*));
- IDecl->setPropertyDecls(properties);
- IDecl->setNumPropertyDecl(pNum);
- }
+ if (ObjCInterfaceDecl *IDecl = dyn_cast<ObjCInterfaceDecl>(ClassDecl))
+ IDecl->addProperties((ObjCPropertyDecl**)allProperties, pNum);
for (unsigned i = 0; i < allNum; i++ ) {
ObjCMethodDecl *Method =