summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-03-17 01:19:02 +0000
committerChris Lattner <sabre@nondot.org>2008-03-17 01:19:02 +0000
commited0e16404c96548826d7a71b47a54e93cbe56328 (patch)
treedb4ff46ddbe9371ffcce21ae3e34800772d9b1e6 /clang/lib/Sema/SemaDeclObjC.cpp
parent41eec3d0979e80cbe7e754b4e3c85acc00cc8dd6 (diff)
downloadbcm5719-llvm-ed0e16404c96548826d7a71b47a54e93cbe56328.tar.gz
bcm5719-llvm-ed0e16404c96548826d7a71b47a54e93cbe56328.zip
clean up property memory allocation to move it into the ast classes
like the rest of the classes. llvm-svn: 48434
Diffstat (limited to 'clang/lib/Sema/SemaDeclObjC.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp29
1 files changed, 14 insertions, 15 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index 335122ebfa5..12706534999 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/lib/Sema/SemaDeclObjC.cpp
@@ -893,43 +893,42 @@ Sema::DeclTy *Sema::ActOnMethodDeclaration(
}
Sema::DeclTy *Sema::ActOnAddObjCProperties(SourceLocation AtLoc,
- DeclTy **allProperties, unsigned NumProperties, ObjCDeclSpec &DS) {
+ DeclTy **allProperties,
+ unsigned NumProperties,
+ ObjCDeclSpec &DS) {
ObjCPropertyDecl *PDecl = ObjCPropertyDecl::Create(Context, AtLoc);
- if(DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_readonly)
+ if (DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_readonly)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readonly);
- if(DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_getter) {
+ if (DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_getter) {
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_getter);
PDecl->setGetterName(DS.getGetterName());
}
- if(DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_setter) {
+ if (DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_setter) {
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_setter);
PDecl->setSetterName(DS.getSetterName());
}
- if(DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_assign)
+ if (DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_assign)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_assign);
- if(DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_readwrite)
+ if (DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_readwrite)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readwrite);
- if(DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_retain)
+ if (DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_retain)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_retain);
- if(DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_copy)
+ if (DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_copy)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_copy);
- if(DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_nonatomic)
+ if (DS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_nonatomic)
PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_nonatomic);
- PDecl->setNumPropertyDecls(NumProperties);
- if (NumProperties != 0) {
- ObjCIvarDecl **properties = new ObjCIvarDecl*[NumProperties];
- memcpy(properties, allProperties, NumProperties*sizeof(ObjCIvarDecl*));
- PDecl->setPropertyDecls(properties);
- }
+ if (NumProperties != 0)
+ PDecl->setPropertyDeclLists((ObjCIvarDecl**)allProperties, NumProperties);
+
return PDecl;
}
OpenPOWER on IntegriCloud