From: Daniel Dunbar Date: Tue, 26 Aug 2008 04:47:31 +0000 (+0000) Subject: Rename ObjCPropertyImplDecl::PropertyImplKind (consistency) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9f0afd4e79601d9982072ff9318e6f9a982c770e;p=clang Rename ObjCPropertyImplDecl::PropertyImplKind (consistency) - Change enum name to Kind. - Change enum constants to English strings. Also, fix getPropertyImplementation (which probably should be renamed) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55354 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Driver/ASTConsumers.cpp b/Driver/ASTConsumers.cpp index 97c0b7f60e..ec809ab69b 100644 --- a/Driver/ASTConsumers.cpp +++ b/Driver/ASTConsumers.cpp @@ -407,8 +407,7 @@ void DeclPrinter::PrintObjCPropertyDecl(ObjCPropertyDecl *PDecl) { /// declaration syntax. /// void DeclPrinter::PrintObjCPropertyImplDecl(ObjCPropertyImplDecl *PID) { - if (PID->getPropertyImplementation() == - ObjCPropertyImplDecl::OBJC_PR_IMPL_SYNTHSIZE) + if (PID->getPropertyImplementation() == ObjCPropertyImplDecl::Synthesize) Out << "\n@synthesize "; else Out << "\n@dynamic "; diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h index 7dc874b5c6..7d16b54f63 100644 --- a/include/clang/AST/DeclObjC.h +++ b/include/clang/AST/DeclObjC.h @@ -1230,9 +1230,9 @@ public: /// class ObjCPropertyImplDecl : public Decl { public: - enum PropertyImplKind { - OBJC_PR_IMPL_SYNTHSIZE, - OBJC_PR_IMPL_DYNAMIC + enum Kind { + Synthesize, + Dynamic }; private: SourceLocation AtLoc; // location of @synthesize or @dynamic @@ -1242,28 +1242,28 @@ private: /// Null for @dynamic. Required for @synthesize. ObjCIvarDecl *PropertyIvarDecl; -public: ObjCPropertyImplDecl(SourceLocation atLoc, SourceLocation L, ObjCPropertyDecl *property, - PropertyImplKind propertyKind, + Kind PK, ObjCIvarDecl *ivarDecl) - : Decl(ObjCPropertyImpl, L), AtLoc(atLoc), PropertyDecl(property), - PropertyIvarDecl(ivarDecl) { - assert (propertyKind == OBJC_PR_IMPL_DYNAMIC || PropertyIvarDecl); - } + : Decl(ObjCPropertyImpl, L), AtLoc(atLoc), PropertyDecl(property), + PropertyIvarDecl(ivarDecl) { + assert (PK == Dynamic || PropertyIvarDecl); + } +public: static ObjCPropertyImplDecl *Create(ASTContext &C, SourceLocation atLoc, SourceLocation L, ObjCPropertyDecl *property, - PropertyImplKind propertyKind, + Kind PK, ObjCIvarDecl *ivarDecl); ObjCPropertyDecl *getPropertyDecl() const { return PropertyDecl; } - PropertyImplKind getPropertyImplementation() const { - return PropertyDecl ? OBJC_PR_IMPL_SYNTHSIZE : OBJC_PR_IMPL_DYNAMIC; + Kind getPropertyImplementation() const { + return PropertyIvarDecl ? Synthesize : Dynamic; } ObjCIvarDecl *getPropertyIvarDecl() { diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index 857224f2b8..a7805f376c 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -705,10 +705,10 @@ ObjCPropertyImplDecl *ObjCPropertyImplDecl::Create(ASTContext &C, SourceLocation atLoc, SourceLocation L, ObjCPropertyDecl *property, - PropertyImplKind kind, + Kind PK, ObjCIvarDecl *ivar) { void *Mem = C.getAllocator().Allocate(); - return new (Mem) ObjCPropertyImplDecl(atLoc, L, property, kind, ivar); + return new (Mem) ObjCPropertyImplDecl(atLoc, L, property, PK, ivar); } diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 872156ee25..b02df056c8 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -1172,9 +1172,9 @@ Sema::DeclTy *Sema::ActOnPropertyImplDecl(SourceLocation AtLoc, ObjCPropertyImplDecl *PIDecl = ObjCPropertyImplDecl::Create(Context, AtLoc, PropertyLoc, property, (Synthesize ? - ObjCPropertyImplDecl::OBJC_PR_IMPL_SYNTHSIZE - : ObjCPropertyImplDecl::OBJC_PR_IMPL_DYNAMIC), - Ivar); + ObjCPropertyImplDecl::Synthesize + : ObjCPropertyImplDecl::Dynamic), + Ivar); if (IC) IC->addPropertyImplementation(PIDecl); else