[cfe-commits] r55354 - in /cfe/trunk: Driver/ASTConsumers.cpp include/clang/AST/DeclObjC.h lib/AST/DeclObjC.cpp lib/Sema/SemaDeclObjC.cpp

Daniel Dunbar daniel at zuster.org
Mon Aug 25 21:47:32 PDT 2008


Author: ddunbar
Date: Mon Aug 25 23:47:31 2008
New Revision: 55354

URL: http://llvm.org/viewvc/llvm-project?rev=55354&view=rev
Log:
Rename ObjCPropertyImplDecl::PropertyImplKind (consistency)
 - Change enum name to Kind.
 - Change enum constants to English strings.

Also, fix getPropertyImplementation (which probably should be renamed)

Modified:
    cfe/trunk/Driver/ASTConsumers.cpp
    cfe/trunk/include/clang/AST/DeclObjC.h
    cfe/trunk/lib/AST/DeclObjC.cpp
    cfe/trunk/lib/Sema/SemaDeclObjC.cpp

Modified: cfe/trunk/Driver/ASTConsumers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/ASTConsumers.cpp?rev=55354&r1=55353&r2=55354&view=diff

==============================================================================
--- cfe/trunk/Driver/ASTConsumers.cpp (original)
+++ cfe/trunk/Driver/ASTConsumers.cpp Mon Aug 25 23:47:31 2008
@@ -407,8 +407,7 @@
 /// declaration syntax.
 ///
 void DeclPrinter::PrintObjCPropertyImplDecl(ObjCPropertyImplDecl *PID) {
-  if (PID->getPropertyImplementation() == 
-      ObjCPropertyImplDecl::OBJC_PR_IMPL_SYNTHSIZE)
+  if (PID->getPropertyImplementation() == ObjCPropertyImplDecl::Synthesize)
     Out << "\n at synthesize ";
   else
     Out << "\n at dynamic ";

Modified: cfe/trunk/include/clang/AST/DeclObjC.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=55354&r1=55353&r2=55354&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/DeclObjC.h (original)
+++ cfe/trunk/include/clang/AST/DeclObjC.h Mon Aug 25 23:47:31 2008
@@ -1230,9 +1230,9 @@
 ///
 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 @@
   /// 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() {

Modified: cfe/trunk/lib/AST/DeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclObjC.cpp?rev=55354&r1=55353&r2=55354&view=diff

==============================================================================
--- cfe/trunk/lib/AST/DeclObjC.cpp (original)
+++ cfe/trunk/lib/AST/DeclObjC.cpp Mon Aug 25 23:47:31 2008
@@ -705,10 +705,10 @@
                                                    SourceLocation atLoc,
                                                    SourceLocation L,
                                                    ObjCPropertyDecl *property,
-                                                   PropertyImplKind kind,
+                                                   Kind PK,
                                                    ObjCIvarDecl *ivar) {
   void *Mem = C.getAllocator().Allocate<ObjCPropertyImplDecl>();
-  return new (Mem) ObjCPropertyImplDecl(atLoc, L, property, kind, ivar);
+  return new (Mem) ObjCPropertyImplDecl(atLoc, L, property, PK, ivar);
 }
 
 

Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=55354&r1=55353&r2=55354&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Mon Aug 25 23:47:31 2008
@@ -1172,9 +1172,9 @@
   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





More information about the cfe-commits mailing list