From 0152a1a5db3f8a29b6795633a947ecbc7efc237e Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Mon, 14 Apr 2008 23:36:35 +0000 Subject: New AST representation for each objc2's property declaration. llvm-svn: 49699 --- clang/lib/Sema/Sema.h | 6 ++---- clang/lib/Sema/SemaDeclObjC.cpp | 21 +++++---------------- 2 files changed, 7 insertions(+), 20 deletions(-) (limited to 'clang/lib/Sema') diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h index 7b305737c2a..50842f7d3a6 100644 --- a/clang/lib/Sema/Sema.h +++ b/clang/lib/Sema/Sema.h @@ -655,10 +655,8 @@ public: DeclTy **allMethods = 0, unsigned allNum = 0, DeclTy **allProperties = 0, unsigned pNum = 0); - virtual DeclTy *ActOnAddObjCProperties(Scope *S, SourceLocation AtLoc, - FieldDeclarator *allProperties, - unsigned NumProperties, - ObjCDeclSpec &ODS); + virtual DeclTy *ActOnProperty(Scope *S, SourceLocation AtLoc, + FieldDeclarator &FD, ObjCDeclSpec &ODS); virtual DeclTy *ActOnMethodDeclaration( SourceLocation BeginLoc, // location of the + or -. SourceLocation EndLoc, // location of the ; or {. diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index 7eb132ec404..bf9af85a6c6 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -886,13 +886,12 @@ Sema::DeclTy *Sema::ActOnMethodDeclaration( return ObjCMethod; } -Sema::DeclTy *Sema::ActOnAddObjCProperties(Scope *S, SourceLocation AtLoc, - FieldDeclarator *propertyDeclarators, - unsigned NumPropertyDeclarators, - ObjCDeclSpec &ODS) { - FieldDeclarator &FD = propertyDeclarators[0]; +Sema::DeclTy *Sema::ActOnProperty(Scope *S, SourceLocation AtLoc, + FieldDeclarator &FD, + ObjCDeclSpec &ODS) { QualType T = GetTypeForDeclarator(FD.D, S); - ObjCPropertyDecl *PDecl = ObjCPropertyDecl::Create(Context, AtLoc, T); + ObjCPropertyDecl *PDecl = ObjCPropertyDecl::Create(Context, AtLoc, + FD.D.getIdentifier(), T); if (ODS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_readonly) PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_readonly); @@ -922,16 +921,6 @@ Sema::DeclTy *Sema::ActOnAddObjCProperties(Scope *S, SourceLocation AtLoc, if (ODS.getPropertyAttributes() & ObjCDeclSpec::DQ_PR_nonatomic) PDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_nonatomic); - if (NumPropertyDeclarators != 0) { - NamedDecl **propertyName = new NamedDecl*[NumPropertyDeclarators]; - PDecl->setPropertyDecls(propertyName); - PDecl->setNumPropertyDecls(NumPropertyDeclarators); - for (unsigned i = 0; i < NumPropertyDeclarators; i++) { - Declarator &D = propertyDeclarators[i].D; - propertyName[i] = new NamedDecl(Decl::ObjCProperty, - D.getIdentifierLoc(), D.getIdentifier()); - } - } return PDecl; } -- cgit v1.2.3