After further discussion, rename attribute 'objc_disable_automatic_synthesis' to...
authorTed Kremenek <kremenek@apple.com>
Thu, 5 Jan 2012 22:47:47 +0000 (22:47 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 5 Jan 2012 22:47:47 +0000 (22:47 +0000)
llvm-svn: 147622

clang/include/clang/AST/DeclObjC.h
clang/include/clang/Basic/Attr.td
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Sema/AttributeList.h
clang/lib/Sema/AttributeList.cpp
clang/lib/Sema/SemaDeclAttr.cpp
clang/lib/Sema/SemaDeclObjC.cpp
clang/lib/Sema/SemaObjCProperty.cpp
clang/test/SemaObjC/default-synthesize-3.m

index 782886817cc017a1f36c5e52bfa4423de2bcf0dc..576b588e898531254a0451909dfef051af559070 100644 (file)
@@ -866,13 +866,13 @@ public:
    return false;
   }
 
-  /// isObjCSuppressAutosynthesis - Checks that a class or one of its super 
+  /// isObjCRequiresPropertyDefs - Checks that a class or one of its super 
   /// classes must not be auto-synthesized. Returns class decl. if it must not be;
   /// 0, otherwise.
-  const ObjCInterfaceDecl *isObjCSuppressAutosynthesis() const {
+  const ObjCInterfaceDecl *isObjCRequiresPropertyDefs() const {
     const ObjCInterfaceDecl *Class = this;
     while (Class) {
-      if (Class->hasAttr<ObjCSuppressAutosynthesisAttr>())
+      if (Class->hasAttr<ObjCRequiresPropertyDefsAttr>())
         return Class;
       Class = Class->getSuperClass();
    }
index 3377fee62d5cba2f1b019d9803f2bbb74e7fed10..f414fc62373294dbb65e0f72b9963075d81a7a4f 100644 (file)
@@ -524,8 +524,8 @@ def ArcWeakrefUnavailable : InheritableAttr {
   let Spellings = ["objc_arc_weak_reference_unavailable"];
 }
 
-def ObjCSuppressAutosynthesis : InheritableAttr {
-  let Spellings = ["objc_disable_automatic_synthesis"];
+def ObjCRequiresPropertyDefs : InheritableAttr {
+  let Spellings = ["objc_requires_property_definitions"];
 }
 
 def Unused : InheritableAttr {
index 07e6c64b24ef9c6e31ac949f2b413b17f17cdfe3..3a11d14b22b928f354817ac460022df308bdbc1f 100644 (file)
@@ -380,7 +380,7 @@ def note_implementation_declared : Note<
 def note_class_declared : Note<
   "class is declared here">;
 def note_suppressed_class_declare : Note<
-  "class with specified objc_disable_automatic_synthesis attribute is declared here">;
+  "class with specified objc_requires_property_definitions attribute is declared here">;
 def warn_dup_category_def : Warning<
   "duplicate definition of category %1 on interface %0">;
 def err_conflicting_super_class : Error<"conflicting super class name %0">;
@@ -1374,7 +1374,7 @@ def err_attribute_wrong_number_arguments : Error<
 def err_attribute_too_many_arguments : Error<
   "attribute takes no more than %0 argument%s0">;
 def err_suppress_autosynthesis : Error<
-  "objc_disable_automatic_synthesis attribute may only be specified on a class"
+  "objc_requires_property_definitions attribute may only be specified on a class"
   "to a class declaration">;
 def err_attribute_too_few_arguments : Error<
   "attribute takes at least %0 argument%s0">;
index 1d0cfd1489a48932d67516039a91f39c380b89ab..a54c1828aefb53138ed664c5cb3c32c10a21e815 100644 (file)
@@ -169,7 +169,7 @@ public:
     AT_analyzer_noreturn,
     AT_annotate,
     AT_arc_weakref_unavailable,
-    AT_objc_disable_automatic_synthesis,
+    AT_objc_requires_property_definitions,
     AT_availability,      // Clang-specific
     AT_base_check,
     AT_blocks,
index 6892ce2f790ed53fb470b0c548c91ffd5606e386..c184676b9e5a72bc18a9bb841e06c1b95ea678b0 100644 (file)
@@ -108,7 +108,7 @@ AttributeList::Kind AttributeList::getKind(const IdentifierInfo *Name) {
     .Case("weak", AT_weak)
     .Case("weakref", AT_weakref)
     .Case("objc_arc_weak_reference_unavailable", AT_arc_weakref_unavailable)
-    .Case("objc_disable_automatic_synthesis", AT_objc_disable_automatic_synthesis)
+    .Case("objc_requires_property_definitions", AT_objc_requires_property_definitions)
     .Case("pure", AT_pure)
     .Case("mode", AT_mode)
     .Case("used", AT_used)
index 8431076a24736cd08059b0b247565afb2c47f0eb..0b8e9fa2d0fb3705334ff85624087884aca38ae0 100644 (file)
@@ -1579,7 +1579,7 @@ static void handleArcWeakrefUnavailableAttr(Sema &S, Decl *D,
                                           Attr.getRange(), S.Context));
 }
 
-static void handleObjCSuppressAutosynthesisAttr(Sema &S, Decl *D, 
+static void handleObjCRequiresPropertyDefsAttr(Sema &S, Decl *D, 
                                             const AttributeList &Attr) {
   if (!isa<ObjCInterfaceDecl>(D)) {
     S.Diag(Attr.getLoc(), diag::err_suppress_autosynthesis);
@@ -1592,7 +1592,7 @@ static void handleObjCSuppressAutosynthesisAttr(Sema &S, Decl *D,
     return;
   }
   
-  D->addAttr(::new (S.Context) ObjCSuppressAutosynthesisAttr(
+  D->addAttr(::new (S.Context) ObjCRequiresPropertyDefsAttr(
                                  Attr.getRange(), S.Context));
 }
 
@@ -3620,8 +3620,8 @@ static void ProcessInheritableDeclAttr(Sema &S, Scope *scope, Decl *D,
   case AttributeList::AT_arc_weakref_unavailable: 
     handleArcWeakrefUnavailableAttr (S, D, Attr); 
     break;
-  case AttributeList::AT_objc_disable_automatic_synthesis: 
-    handleObjCSuppressAutosynthesisAttr (S, D, Attr); 
+  case AttributeList::AT_objc_requires_property_definitions: 
+    handleObjCRequiresPropertyDefsAttr (S, D, Attr); 
     break;
   case AttributeList::AT_unused:      handleUnusedAttr      (S, D, Attr); break;
   case AttributeList::AT_returns_twice:
index ad230b471319a7034370f024b5dd781cfa805c61..6a55de0c4579c826fd599610c861ca0ef4cdb06d 100644 (file)
@@ -1667,7 +1667,7 @@ void Sema::ImplMethodsVsClassMethods(Scope *S, ObjCImplDecl* IMPDecl,
   // of the property in the @implementation.
   if (const ObjCInterfaceDecl *IDecl = dyn_cast<ObjCInterfaceDecl>(CDecl))
     if  (!(LangOpts.ObjCDefaultSynthProperties && LangOpts.ObjCNonFragileABI2) ||
-      IDecl->isObjCSuppressAutosynthesis())
+      IDecl->isObjCRequiresPropertyDefs())
       DiagnoseUnimplementedProperties(S, IMPDecl, CDecl, InsMap);
       
   llvm::DenseSet<Selector> ClsMap;
index 45c47756347523fb4d39e48a9994e892824587a6..6379c924e29cca317c35e425ddbd0e713606d5fd 100644 (file)
@@ -857,7 +857,7 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S,
     IC->addPropertyImplementation(PIDecl);
     if (getLangOptions().ObjCDefaultSynthProperties &&
         getLangOptions().ObjCNonFragileABI2 &&
-        !IDecl->isObjCSuppressAutosynthesis()) {
+        !IDecl->isObjCRequiresPropertyDefs()) {
       // Diagnose if an ivar was lazily synthesdized due to a previous
       // use and if 1) property is @dynamic or 2) property is synthesized
       // but it requires an ivar of different name.
@@ -1356,7 +1356,7 @@ void Sema::DefaultSynthesizeProperties(Scope *S, Decl *D) {
   if (!IC)
     return;
   if (ObjCInterfaceDecl* IDecl = IC->getClassInterface())
-    if (!IDecl->isObjCSuppressAutosynthesis())
+    if (!IDecl->isObjCRequiresPropertyDefs())
       DefaultSynthesizeProperties(S, IC, IDecl);
 }
 
@@ -1396,7 +1396,7 @@ void Sema::DiagnoseUnimplementedProperties(Scope *S, ObjCImplDecl* IMPDecl,
            diag::note_property_declare);
       if (LangOpts.ObjCDefaultSynthProperties && LangOpts.ObjCNonFragileABI2)
         if (ObjCInterfaceDecl *ID = dyn_cast<ObjCInterfaceDecl>(CDecl))
-          if (const ObjCInterfaceDecl *RID = ID->isObjCSuppressAutosynthesis())
+          if (const ObjCInterfaceDecl *RID = ID->isObjCRequiresPropertyDefs())
             Diag(RID->getLocation(), diag::note_suppressed_class_declare);
             
     }
@@ -1411,7 +1411,7 @@ void Sema::DiagnoseUnimplementedProperties(Scope *S, ObjCImplDecl* IMPDecl,
            diag::note_property_declare);
       if (LangOpts.ObjCDefaultSynthProperties && LangOpts.ObjCNonFragileABI2)
         if (ObjCInterfaceDecl *ID = dyn_cast<ObjCInterfaceDecl>(CDecl))
-          if (const ObjCInterfaceDecl *RID = ID->isObjCSuppressAutosynthesis())
+          if (const ObjCInterfaceDecl *RID = ID->isObjCRequiresPropertyDefs())
             Diag(RID->getLocation(), diag::note_suppressed_class_declare);
     }
   }
index cba3b9aff7680047b57e737a02b10a74b2c64a33..9bbc6847870f1fab13e2829d978b90749c20461a 100644 (file)
@@ -1,10 +1,10 @@
 // RUN: %clang_cc1 -x objective-c -fsyntax-only -fobjc-default-synthesize-properties -verify %s
 // RUN: %clang_cc1 -x objective-c++ -fsyntax-only -fobjc-default-synthesize-properties -verify %s
 
-#if __has_attribute(objc_disable_automatic_synthesis)
-__attribute ((objc_disable_automatic_synthesis)) 
+#if __has_attribute(objc_requires_property_definitions)
+__attribute ((objc_requires_property_definitions)) 
 #endif
-@interface NoAuto // expected-note 2 {{class with specified objc_disable_automatic_synthesis attribute is declared here}}
+@interface NoAuto // expected-note 2 {{class with specified objc_requires_property_definitions attribute is declared here}}
 @property int NoAutoProp; // expected-note 2 {{property declared here}}
 @end
 
@@ -12,8 +12,8 @@ __attribute ((objc_disable_automatic_synthesis))
                         // expected-warning {{property 'NoAutoProp' requires method 'setNoAutoProp:'}}
 @end
 
-__attribute ((objc_disable_automatic_synthesis))  // redundant, just for testing
-@interface Sub : NoAuto  // expected-note 3 {{class with specified objc_disable_automatic_synthesis attribute is declared here}}
+__attribute ((objc_requires_property_definitions))  // redundant, just for testing
+@interface Sub : NoAuto  // expected-note 3 {{class with specified objc_requires_property_definitions attribute is declared here}}
 @property (copy) id SubProperty; // expected-note 2 {{property declared here}}
 @end
 
@@ -33,9 +33,9 @@ __attribute ((objc_disable_automatic_synthesis))  // redundant, just for testing
 - (id) DeepMustSynthProperty { return 0; }
 @end
 
-__attribute ((objc_disable_automatic_synthesis)) 
+__attribute ((objc_requires_property_definitions)) 
 @interface Deep(CAT)  // expected-error {{attributes may not be specified on a category}}
 @end
 
-__attribute ((objc_disable_automatic_synthesis)) // expected-error {{objc_disable_automatic_synthesis attribute may only be specified on a class}} 
+__attribute ((objc_requires_property_definitions)) // expected-error {{objc_requires_property_definitions attribute may only be specified on a class}} 
 @protocol P @end