]> granicus.if.org Git - clang/commitdiff
Rename ObjCPropertyImplDecl::PropertyImplKind (consistency)
authorDaniel Dunbar <daniel@zuster.org>
Tue, 26 Aug 2008 04:47:31 +0000 (04:47 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 26 Aug 2008 04:47:31 +0000 (04:47 +0000)
 - 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

Driver/ASTConsumers.cpp
include/clang/AST/DeclObjC.h
lib/AST/DeclObjC.cpp
lib/Sema/SemaDeclObjC.cpp

index 97c0b7f60ef646ba6e8060dbca1ae9a777cf5881..ec809ab69b86f3e7253e5e1ada4c2b1879aac03b 100644 (file)
@@ -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 ";
index 7dc874b5c6fa264f5c5290cb027f0e6ffb8d78a0..7d16b54f637252bc18772f74090f1c7bc95638f1 100644 (file)
@@ -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() {
index 857224f2b89fcfbd367d9b0f7b1710fd554c2f3f..a7805f376cb974685f2d18099c8616a84a86df47 100644 (file)
@@ -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<ObjCPropertyImplDecl>();
-  return new (Mem) ObjCPropertyImplDecl(atLoc, L, property, kind, ivar);
+  return new (Mem) ObjCPropertyImplDecl(atLoc, L, property, PK, ivar);
 }
 
 
index 872156ee25758460d623fdee1ce8edc86b41853d..b02df056c82716340282a9530d22271b2cb00eff 100644 (file)
@@ -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